Exemplo n.º 1
0
/*
 * Run one FFT test
 */
void TestOneFFT(int fft_log_size,
                int signal_type,
                float signal_value,
                const struct TestInfo* info,
                const char* message) {
  struct SnrResult snr;

  if (info->do_forward_tests_) {
    RunOneForwardTest(fft_log_size, signal_type, signal_value, &snr);
    printf("Forward %s\n", message);
    printf("SNR:  real part    %10.3f dB\n", snr.real_snr_);
    printf("      imag part    %10.3f dB\n", snr.imag_snr_);
    printf("      complex part %10.3f dB\n", snr.complex_snr_);
  }

  if (info->do_inverse_tests_) {
    RunOneInverseTest(fft_log_size, signal_type, signal_value, &snr);
    printf("Inverse %s\n", message);
    if (info->real_only_) {
      printf("SNR:  real         %10.3f dB\n", snr.real_snr_);
    } else {
      printf("SNR:  real part    %10.3f dB\n", snr.real_snr_);
      printf("      imag part    %10.3f dB\n", snr.imag_snr_);
      printf("      complex part %10.3f dB\n", snr.complex_snr_);
    }
  }
}
Exemplo n.º 2
0
/*
 * Run one test of the forward and inverse FFT for the specified FFT
 * size, signal type and amplitude
 */
void TestFloatFFT(int fft_log_size, int signal_type, float signal_value) {
  struct SnrResult snr;

  RunOneForwardTest(fft_log_size, signal_type, signal_value, &snr);
  printf("Forward float FFT\n");
  printf("SNR:  real part    %f dB\n", snr.real_snr_);
  printf("      imag part    %f dB\n", snr.imag_snr_);
  printf("      complex part %f dB\n", snr.complex_snr_);

  RunOneInverseTest(fft_log_size, signal_type, signal_value, &snr);
  printf("Inverse float FFT\n");
  printf("SNR:  %f dB\n", snr.real_snr_);
}