Radio Control  Control Software and GUI for the Panoradio SDR, by DC9ST 2016
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
fftw_base Class Reference

Base class for FFT for time domain voltage input data from an ADC (wrapped FFTW) More...

#include <fftw_base.h>

Inheritance diagram for fftw_base:
fft_avg_complex fft_avg_real fft_basic

Public Types

enum  t_fft_window { no, hann, flat }
 window types
 

Public Member Functions

 fftw_base (int n, t_fft_window fft_window)
 constructor, allocates memory, sets parameter for magnitude calculation and windowing coefficients More...
 
virtual ~fftw_base ()
 destructor
 

Protected Member Functions

void real_fft_linear_power (double data_in[], double data_out_mag[])
 performs FFT on real input values, including windowing, no CPG correction More...
 
void complex_fft_linear_power (double data_in_real[], double data_in_imag[], double data_out_mag[])
 performs FFT on complex input values, including windowing, no CPG correction More...
 
void linear2dbm_real (double data_out_mag[])
 converts a linear scaled power spectrum of real input values into a power spectrum in dBm (same as "linear2dbm_complex" but with n/2 values) More...
 
void linear2dbm_complex (double data_out_mag[])
 converts a linear scaled power spectrum of complex input values into a power spectrum in dBm (same as "linear2dbm_real" but with n values) More...
 
void correct_coherent_gain_real (double data_out_mag[])
 corrects the coherent power gain (caused by windowing) of a power spectrum in dBm of real input values (n/2 samples) More...
 
void correct_coherent_gain_complex (double data_out_mag[])
 corrects the coherent power gain (caused by windowing) of a power spectrum in dBm of complex input values (n samples) More...
 

Protected Attributes

int n_
 FFT size.
 
double resistor_ref_
 resistance in Ohms of a resistor over which the input voltage occurs
 
double adc_full_scale_voltage_
 full scale voltage of ADC in Volts
 
int num_adc_bits_
 number of ADC bits
 
double coherent_gain_
 coherent power gain of selected window
 
t_fft_window fft_window_
 selected window
 
double * window_weights_
 pointer to array of window weight coefficients
 
fftw_plan * my_fftw_plan_
 FFTW specific module for FFT calculation.
 
fftw_complex * in_
 FFTW specific buffer for FFT input data.
 
fftw_complex * out_
 FFTW specific buffer for FFT output data.
 
double * data_out_mag_complex_temp_
 temporary array required when reordering the bins of a complex FFT
 

Detailed Description

Base class for FFT for time domain voltage input data from an ADC (wrapped FFTW)

Constructor & Destructor Documentation

fftw_base::fftw_base ( int  n,
t_fft_window  fft_window 
)

constructor, allocates memory, sets parameter for magnitude calculation and windowing coefficients

Parameters
nFFT size an length of input data
fft_windowFFT window to use

Member Function Documentation

void fftw_base::complex_fft_linear_power ( double  data_in_real[],
double  data_in_imag[],
double  data_out_mag[] 
)
protected

performs FFT on complex input values, including windowing, no CPG correction

Parameters
data_in_real[]array containing n input time domain samples, real part
data_in_imag[]array containing n input time domain samples, imaginary part
data_out_mag[]array for the n FFT bins of the linear scaled power spectrum
void fftw_base::correct_coherent_gain_complex ( double  data_out_mag[])
protected

corrects the coherent power gain (caused by windowing) of a power spectrum in dBm of complex input values (n samples)

Parameters
data_out_mag[]array containing n bins of a power spectrum in dBm, that will be corrected in situ
void fftw_base::correct_coherent_gain_real ( double  data_out_mag[])
protected

corrects the coherent power gain (caused by windowing) of a power spectrum in dBm of real input values (n/2 samples)

Parameters
data_out_mag[]array containing n/2 bins of a power spectrum in dBm, that will be corrected in situ
void fftw_base::linear2dbm_complex ( double  data_out_mag[])
protected

converts a linear scaled power spectrum of complex input values into a power spectrum in dBm (same as "linear2dbm_real" but with n values)

Parameters
data_out_mag[]array containing n bins of a linear power spectrum, that will be converted to dBm in situ
void fftw_base::linear2dbm_real ( double  data_out_mag[])
protected

converts a linear scaled power spectrum of real input values into a power spectrum in dBm (same as "linear2dbm_complex" but with n/2 values)

Parameters
data_out_mag[]array containing n/2 bins of a linear power spectrum, that will be converted to dBm in situ
void fftw_base::real_fft_linear_power ( double  data_in[],
double  data_out_mag[] 
)
protected

performs FFT on real input values, including windowing, no CPG correction

Parameters
data_in[]array containing n real input time domain samples
data_out_mag[]array for the n/2 FFT bins of the linear scaled power spectrum

The documentation for this class was generated from the following files: