-
Notifications
You must be signed in to change notification settings - Fork 7
/
FT8Generator.h
37 lines (30 loc) · 1 KB
/
FT8Generator.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
#pragma once
#include <string>
#include "common.h"
#include "wave.h"
#include "debug.h"
#include "pack.h"
#include "encode.h"
#include "constants.h"
#include "SdrberryTypeDefs.h"
#include "DataBuffer.h"
#include "Settings.h"
#include "AudioInput.h"
#define LOG_LEVEL LOG_INFO
#define FT8_SYMBOL_BT 2.0f ///< symbol smoothing filter bandwidth factor (BT)
#define FT4_SYMBOL_BT 1.0f ///< symbol smoothing filter bandwidth factor (BT)
#define MAX_NUM_SYMBOLS 250
#define GFSK_CONST_K 5.336446f ///< == pi * sqrt(2 / log(2))
bool stdCall(std::string const &w);
class FT8Generator
{
public:
FT8Generator(AudioInput *input) { audioinput = input; }
vector<float> generate(int frequency, encoding code,std::string message);
private:
int itone[MAX_NUM_SYMBOLS] = {0};
SampleVector audioSamples;
AudioInput *audioinput;
void gfsk_pulse(int n_spsym, float symbol_bt, float *pulse);
void synth_gfsk(const uint8_t *symbols, int n_sym, float f0, float symbol_bt, float symbol_period, int signal_rate, float *signal);
};