-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathAMDemodulator.h
43 lines (37 loc) · 1.18 KB
/
AMDemodulator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include <cstdio>
#include <cassert>
#include <cmath>
#include <complex>
#include <liquid/liquid.h>
#include <vector>
#include "DataBuffer.h"
#include "AudioOutput.h"
#include "AudioInput.h"
#include "Demodulator.h"
#include "MorseDecoder.h"
#include "LMSNoisereducer.h"
#include "SpectralNoiseReduction.h"
#include "Agc_class.h"
class AMDemodulator : public Demodulator
{
public:
static bool create_demodulator(int mode, double ifrate, DataBuffer<IQSample> *source_buffer, AudioOutput *audio_output);
static void destroy_demodulator();
static std::string getName() { return "AMDemodulator";}
static void setLowPassAudioFilterCutOffFrequency(int ifilter);
AMDemodulator(int mode, double ifrate, DataBuffer<IQSample> *source_buffer, AudioOutput *audio_output);
~AMDemodulator();
void process(const IQSampleVector& samples_in, SampleVector& audio);
void operator()() override;
atomic<bool> stop_flag {false};
std::thread amdemod_thread;
private:
ampmodem demodulatorHandle {nullptr};
Agc_class agc;
unique_ptr<MorseDecoder> pMDecoder;
unique_ptr<LMSNoisereducer> pLMS;
unique_ptr<Xanr> pXanr;
unique_ptr<SpectralNoiseReduction> pNoisesp;
int receiverMode;
};