-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathAMModulator.h
35 lines (29 loc) · 1.03 KB
/
AMModulator.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
#pragma once
#include "Demodulator.h"
#include "DigitalTransmission.h"
class AMModulator : public Demodulator
{
public:
AMModulator(ModulatorParameters ¶m, DataBuffer<IQSample> *source_buffer, AudioInput *audio_input);
~AMModulator();
void process(const SampleVector &samples, IQSampleVector &samples_out);
void setsignal(vector<float> &signal);
void operator()();
static void destroy_modulator();
static bool create_modulator(ModulatorParameters param, DataBuffer<IQSample> *source_buffer, AudioInput *audio_input);
static void setLowPassAudioFilterCutOffFrequency(int bandwidth);
atomic<bool> stop_flag{false};
std::thread ammod_thread;
private:
ampmodem AMmodulatorHandle{nullptr};
bool even;
bool digitalmode;
nco_crcf m_fft{nullptr};
void fft_offset(long offset);
void mix_up_fft(const IQSampleVector &filter_in, IQSampleVector &filter_out);
SampleVector audioframes;
void audio_feedback(const SampleVector &audiosamples);
void WaitForTimeSlot();
vector<float> signal;
};
extern shared_ptr<AMModulator> sp_ammod;