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
| 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. |
| 118 | ModemKit *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 | |
| 129 | void ModemCW::disposeKit(ModemKit *kit) { |
| 130 | auto *cwkit = (ModemKitCW *) kit; |
nothing calls this directly
no outgoing calls
no test coverage detected