MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / buildKit

Method buildKit

src/modules/modem/analog/ModemCW.cpp:118–127  ·  view source on GitHub ↗

The modem object is asked to make a "ModemKit" given the IQ sample rate and the audio sample rate. For the CW modem the IQ sample rate is small or narrow bandwidth. The demodulated sample rate must be fast enough to sample 200-1000Hz tones. If the IQ sample rate is less than 2000Hz then one doesn't have the bandwidth for these tones. So we need to interpolate the input IQ to audioOut, frequency sh

Source from the content-addressed store, hash-verified

116// the input IQ to audioOut, frequency shift, then pass the real part.
117// Simple solution is just interpolate the IQ data to the audio sample rate.
118ModemKit *ModemCW::buildKit(long long sampleRate, int audioSampleRate) {
119 auto *kit = new ModemKitCW();
120 float As = 60.0f;
121 double ratio = double(audioSampleRate) / double(sampleRate);
122 kit->sampleRate = sampleRate;
123 kit->audioSampleRate = audioSampleRate;
124 kit->audioResampleRatio = ratio;
125 kit->mInputResampler = msresamp_cccf_create((float)ratio, As);
126 return kit;
127}
128
129void ModemCW::disposeKit(ModemKit *kit) {
130 auto *cwkit = (ModemKitCW *) kit;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected