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

Class for controlling the Waterfall DDC
. More...

#include <waterfallddc.h>

Inheritance diagram for WaterfallDDC:

Signals

void audio_frequency_clicked (double frequency)
 sends the frequency for tuning the audio receiver (when right clicking in the waterfall) More...
 

Public Member Functions

 WaterfallDDC ()
 constructor
 
 ~WaterfallDDC ()
 destructor
 
void init_lo (int address, int memsize, double master_frequency, int phase_width, double init_frequency)
 initializes LO IP core, required to run before using the DDC! More...
 
void init_cic (int filter_address, int filter_memsize, int bypass_address, int bypass_memsize)
 initializes CIC IP cores (rate prog and bypass), required to run before using the DDC! More...
 
void init_iq_capture (int address, int memsize, int capture_size)
 initializes Dual Capture IP core for IQ data, required to run before using the DDC! More...
 
void init_rf_capture (int address, int memsize, int capture_size)
 initializes the RF capture module, instanciated outside of this class More...
 
void init_waterfall (WaterfallPlot *waterfall, double max_frequency, double data_range_min, double data_range_max, double span_init, int data_size, int waterfall_depth, double usable_span_frac)
 initializes the Waterfall DDC, required to run before use! More...
 
void init_fft (int fft_rf_size, int fft_iq_size, int window_type)
 initializes the FFT cores and data arrays for FFT and related processing More...
 
void init_labels (QLabel *label_zoom, QLabel *label_resolution, QLabel *label_bandwidth, QLabel *label_lo_freq, QLabel *label_cic_dec, QLabel *label_fir_dec, QLabel *label_fft)
 OPTIONAL: initializes labels for status display in the GUI, in which the WaterfallDDC can write status information.
 
void init_spectrum_line_plot (QwtPlot *spectrum_line_plot)
 OPTIONAL: initializes support to display the spectrum in an extra line plot (QwtPlot) More...
 
void set_color_map (QwtLinearColorMap color_map)
 sets the color map of the plot (a default is assinged in the constructor)
 
void set_gain_ddc (int gain_ddc)
 sets the DDC gain in dB, that will be subtracted from the FFT power bins (without RF scaler gain)
 
void set_gain_rf_scaler (int gain_rf_scaler)
 sets the RF Scaler gain in dB, that will be subtracted from the FFT power bins
 
void set_num_ffts (int num_ffts)
 sets number of FFTs, that are averaged
 
void capture_and_show (fstream &record_file, bool record_data)
 captures IQ data (after DDC) and shows them as a new line in the waterfall plot
 
void correct_waterfall_size ()
 required to call to resize the plot to the data length
 
int get_fft_rf_size ()
 get data block length for real fft (fft_rf_size_/2 output bins)
 
int get_fft_iq_size ()
 get data block length for complex fft
 
int data_size ()
 get data block length for complex fft
 
void set_debug (bool debug_en)
 enables the debug mode, which stops the waterfall and allows to set the DDC parameters and IP cores directly (for debug)
 
void debug_set_cic (int dec)
 forces the CIC filter to the given decimation factor (for debug)
 
void debug_set_lo (double freq)
 forces the LO to the given frequency (for debug)
 
void debug_capture_iq_samples (double samples_i[], double samples_q[], int size)
 returns IQ captured data (for debug)
 
void debug_capture_rf_samples (double samples[], int size)
 returns RF captured data (for debug)
 

Private Member Functions

void set_cic (int decimation_rate)
 
double set_lo_frequency (double lo_frequency)
 
void decimate_spectrum (double data_in[], int data_in_size, double data_out[], int data_out_size)
 converts long spectrum in a shorter one, using simple max operation
 

Private Attributes

fft_avg_realfft_real_
 
fft_avg_complexfft_complex_
 
DDS * local_oscillator_
 
CIC * cic_filter_
 
IP_Driver * cic_bypass_
 
Data_Capture_Dual * iq_capture_module_
 
WaterfallPlotwaterfall_
 
Data_Capture * rf_capture_module_
 
QwtPlot * spectrum_line_plot_
 
QwtPlotCurve * spectrum_line_curve_
 
QwtPlotGrid * spectrum_line_grid_
 
QLabel * label_zoom_
 
QLabel * label_resolution_
 
QLabel * label_bandwidth_
 
QLabel * label_lo_freq_
 
QLabel * label_cic_dec_
 
QLabel * label_fir_dec_
 
QLabel * label_fft_
 
double * captured_data_rf_
 
double * captured_data_i_
 
double * captured_data_q_
 
double * spectrum_rf_
 
double * spectrum_iq_
 
double * spectrum_temp_
 
double * spectrum_data_
 
double * spectrum_display_
 
int capture_iq_max_size_
 
int capture_rf_max_size_
 
int fft_rf_size_
 
int fft_iq_size_
 
int data_size_
 
int display_size_
 
bool lo_initialized_
 
bool cic_initialized_
 
bool capture_iq_initialized_
 
bool capture_rf_initialized_
 
bool waterfall_initialized_
 
bool fft_initialized_
 
bool labels_initialized_
 
bool line_plot_initialized_
 
bool debug_enabled_
 
double gain_ddc_
 
double gain_rf_scaler_
 
int num_ffts_
 

Detailed Description

Class for controlling the Waterfall DDC
.

Member Function Documentation

void WaterfallDDC::audio_frequency_clicked ( double  frequency)
signal

sends the frequency for tuning the audio receiver (when right clicking in the waterfall)

Parameters
frequencyfrequency in kHz
void WaterfallDDC::init_cic ( int  filter_address,
int  filter_memsize,
int  bypass_address,
int  bypass_memsize 
)

initializes CIC IP cores (rate prog and bypass), required to run before using the DDC!

Parameters
filter_addressIP core address for programming interface IP core (from Vivado)
filter_memsizeIP core memory size in k for programming interface IP core (from Vivado)
bypass_addressIP core address for CIC bypass interface IP core (from Vivado)
bypass_memsizeIP core memory size in k for CIC bypass interface IP core (from Vivado)
void WaterfallDDC::init_fft ( int  fft_rf_size,
int  fft_iq_size,
int  window_type 
)

initializes the FFT cores and data arrays for FFT and related processing

Parameters
fft_rf_size(input) size for real FFT processing of RF samples
fft_iq_size(input and output) size for complex FFT processing of IQ samples
window_type0=no/rect, 1=hanning, 2=flattop window
void WaterfallDDC::init_iq_capture ( int  address,
int  memsize,
int  capture_size 
)

initializes Dual Capture IP core for IQ data, required to run before using the DDC!

Parameters
addressIP core address (from Vivado)
memsizeIP core memory size in k (from Vivado)
capture_sizedepth of capture memory in i/q sample pairs
void WaterfallDDC::init_lo ( int  address,
int  memsize,
double  master_frequency,
int  phase_width,
double  init_frequency 
)

initializes LO IP core, required to run before using the DDC!

Parameters
addressIP core address (from Vivado)
memsizeIP core memory size in k (from Vivado)
master_frequencyDDS master frequency in kHz (from Vivado)
phase_widthDDS phase width (from Vivado)
init_frequencyinital LO frequency in kHz
void WaterfallDDC::init_rf_capture ( int  address,
int  memsize,
int  capture_size 
)

initializes the RF capture module, instanciated outside of this class

Parameters
addressIP core address (from Vivado)
memsizeIP core memory size in k (from Vivado)
capture_sizedepth of capture memory samples
void WaterfallDDC::init_spectrum_line_plot ( QwtPlot *  spectrum_line_plot)

OPTIONAL: initializes support to display the spectrum in an extra line plot (QwtPlot)

Parameters
spectrum_line_plotpointer to QwtPlot Object, that will display the line spectrum
void WaterfallDDC::init_waterfall ( WaterfallPlot waterfall,
double  max_frequency,
double  data_range_min,
double  data_range_max,
double  span_init,
int  data_size,
int  waterfall_depth,
double  usable_span_frac 
)

initializes the Waterfall DDC, required to run before use!

Parameters
*waterfallpointer to waterfall display
max_frequencymaximum frequency the waterfall can be scrolled to in kHz, give value for usable_span_frac = 1.0 here!!!
data_range_minminimum data value in waterfall
data_range_maxmaximum data value in waterfall
span_initinitial frequency span of waterfall in kHz (= audio IQ signal's sample rate)
data_sizesize of data block for displayed (including aliasing bin, that will be truncated for final display)
waterfall_depthdepth of waterfall display
usable_span_fracprovides a fraction (0 to 1) of how much of the calculated spectrum can be used without aliasing effects

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