Demodulator can now tune offset!

Demodulator will up-convert / down-convert by mixing VCO with incoming
IQ to shift frequency -- No longer limited to center freq. can listen
anywhere on the waterfall.
This commit is contained in:
Charles J. Cliffe
2014-11-27 22:13:21 -05:00
parent df853bfd65
commit 1554348f55
4 changed files with 54 additions and 13 deletions
+10 -4
View File
@@ -199,7 +199,7 @@ void WaterfallCanvas::mouseMoved(wxMouseEvent& event) {
}
DemodulatorThreadCommand command;
command.cmd = DemodulatorThreadCommand::SDR_THREAD_CMD_SETBANDWIDTH;
command.cmd = DemodulatorThreadCommand::SDR_THREAD_CMD_SET_BANDWIDTH;
demodBW = demodBW - bwDiff;
if (demodBW < 1000) {
demodBW = 1000;
@@ -245,11 +245,17 @@ void WaterfallCanvas::mouseReleased(wxMouseEvent& event) {
float pos = mTracker.getMouseX();
int freq = wxGetApp().getFrequency();
int center_freq = wxGetApp().getFrequency();
freq += (pos - 0.5) * SRATE;
DemodulatorInstance *demod = wxGetApp().getDemodTest();
wxGetApp().setFrequency(freq);
int freq = center_freq - (int)(0.5 * (float)SRATE) + (int)((float)pos * (float)SRATE);
DemodulatorThreadCommand command;
command.cmd = DemodulatorThreadCommand::SDR_THREAD_CMD_SET_FREQUENCY;
command.int_value = freq;
demod->getCommandQueue()->push(command);
((wxFrame*) parent)->GetStatusBar()->SetStatusText(
wxString::Format(wxT("Set center frequency: %s"),