2015-11-16 23:49:54 -05:00
|
|
|
#pragma once
|
|
|
|
#include "Modem.h"
|
|
|
|
|
|
|
|
class ModemKitFMStereo: public ModemKit {
|
|
|
|
public:
|
|
|
|
ModemKitFMStereo() : audioResampler(nullptr), stereoResampler(nullptr), audioResampleRatio(0), firStereoLeft(nullptr), firStereoRight(nullptr), iirStereoPilot(nullptr) {
|
|
|
|
}
|
|
|
|
|
|
|
|
msresamp_rrrf audioResampler;
|
|
|
|
msresamp_rrrf stereoResampler;
|
|
|
|
double audioResampleRatio;
|
|
|
|
|
|
|
|
firfilt_rrrf firStereoLeft;
|
|
|
|
firfilt_rrrf firStereoRight;
|
|
|
|
iirfilt_crcf iirStereoPilot;
|
2016-03-01 19:47:18 -05:00
|
|
|
|
|
|
|
firhilbf firStereoR2C;
|
|
|
|
firhilbf firStereoC2R;
|
|
|
|
|
|
|
|
nco_crcf stereoPilot;
|
2015-11-16 23:49:54 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ModemFMStereo : public Modem {
|
|
|
|
public:
|
|
|
|
ModemFMStereo();
|
|
|
|
~ModemFMStereo();
|
2015-11-24 00:20:17 -05:00
|
|
|
|
2015-11-18 23:40:30 -05:00
|
|
|
std::string getType();
|
|
|
|
std::string getName();
|
2015-11-24 00:20:17 -05:00
|
|
|
|
2016-07-24 15:25:17 -04:00
|
|
|
static ModemBase *factory();
|
2015-11-24 00:20:17 -05:00
|
|
|
|
2015-11-22 19:56:25 -05:00
|
|
|
int checkSampleRate(long long sampleRate, int audioSampleRate);
|
2015-11-30 21:58:54 -05:00
|
|
|
int getDefaultSampleRate();
|
2015-11-24 00:20:17 -05:00
|
|
|
|
2015-11-16 23:49:54 -05:00
|
|
|
ModemKit *buildKit(long long sampleRate, int audioSampleRate);
|
|
|
|
void disposeKit(ModemKit *kit);
|
2015-11-24 00:20:17 -05:00
|
|
|
|
2015-11-16 23:49:54 -05:00
|
|
|
void demodulate(ModemKit *kit, ModemIQData *input, AudioThreadInput *audioOut);
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::vector<float> demodOutputData;
|
|
|
|
std::vector<float> demodStereoData;
|
|
|
|
std::vector<float> resampledOutputData;
|
|
|
|
std::vector<float> resampledStereoData;
|
|
|
|
freqdem demodFM;
|
|
|
|
};
|