Radio Control  Control Software and GUI for the Panoradio SDR, by DC9ST 2016
audioddc.h
1 #ifndef AUDIODDC_H
2 #define AUDIODDC_H
3 
4 #include "../waterfall/waterfallplot.h"
5 #include "fft/fft_basic.h"
6 #include "stipcores.h"
7 
13 class AudioDDC: public QObject
14 {
15  Q_OBJECT
16 public:
17  AudioDDC();
18  ~AudioDDC();
19 
20 
27  void init_lo(int address, int memsize, double master_frequency, int phase_width, double init_frequency);
28 
29 
34  void init_capture(int address, int memsize, int capture_size);
35 
36 
45  void init_waterfall(WaterfallPlot *waterfall_audio, int max_frequency, double data_range_min, double data_range_max, double span_init, int data_size, int waterfall_depth);
46 
47 
51  double set_rx_frequency(double rx_frequency);
52 
55  void capture_and_show(double gain_correction);
56 
61  void get_captured_data(double in[], double qu[]) {
62  if (waterfall_initialized_) {
63  for (int i=0; i<data_size_; i++) {
64  in[i] = captured_data_i_[i];
65  qu[i] = captured_data_q_[i];
66  }
67  }
68  else {
69  cerr << "ERROR: audio_ddc.cpp: run init_waterfall before calling capture_and_show" << endl;
70  exit(1);
71  }
72  }
73 
76  if (waterfall_initialized_) waterfall_audio_->correct_size();
77  }
78 
79 signals:
82  void send_new_lo_frequency(double frequency);
83 
84 private:
85  fft_basic *fft_;
86  DDS *local_oscillator_; // Driver for LO
87  Data_Capture_Dual *capture_data_;
88  WaterfallPlot *waterfall_audio_; // Waterfall Display Class
89 
90  double *captured_data_i_;
91  double *captured_data_q_;
92  double *captured_data_fft_dbm_;
93 
94  int capture_max_size_; // depth of capture ip core memory
95  int data_size_; // data block length for fft and waterfall
96 
97  bool lo_initialized_; // signal, which init functions have been called
98  bool capture_initialized_;
99  bool waterfall_initialized_;
100 
101 };
102 
103 #endif // AUDIODDC_H
void get_captured_data(double in[], double qu[])
return the I&Q data for the last data capture (for debugging)
Definition: audioddc.h:61
void capture_and_show(double gain_correction)
captures IQ data (after DDC) and shows them as a new line in the waterfall plot
Definition: audioddc.cpp:93
Class for controlling a single Audio DDC.
Definition: audioddc.h:13
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!
Definition: audioddc.cpp:31
void init_capture(int address, int memsize, int capture_size)
initializes Dual Capture IP core for IQ data, required to run before using the DDC! ...
Definition: audioddc.cpp:38
void send_new_lo_frequency(double frequency)
send the current LO frequency (after it has been newly set, e.g. by a waterfall shift) ...
void correct_size()
corrects the size of the plot area, so that the data width always matches the display width in pixels...
Definition: waterfallplot.cpp:88
double set_rx_frequency(double rx_frequency)
sets LO frequency of DDC
Definition: audioddc.cpp:81
Main FFT Class for single non-averaging FFT (performs FFT of real and complex time domain inputs) ...
Definition: fft_basic.h:7
void init_waterfall(WaterfallPlot *waterfall_audio, int max_frequency, double data_range_min, double data_range_max, double span_init, int data_size, int waterfall_depth)
initializes the audio DDC, required to run after use!
Definition: audioddc.cpp:45
void correct_waterfall_size()
selects the correct size of the audio receiver&#39;s waterfall
Definition: audioddc.h:75
Top class for Waterfall Plots ,.
Definition: waterfallplot.h:16