forked from paulh002/sdrberry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsdrberry.h
92 lines (82 loc) · 2.04 KB
/
sdrberry.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#pragma once
#include <complex>
#include <vector>
#include <mutex>
#include <memory>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <sys/time.h>
#include <stdint.h>
#include <liquid.h>
#include <unistd.h>
#include <pthread.h>
#include <thread>
#include "RtAudio.h"
#include "DataBuffer.h"
#include "Audiodefs.h"
#include "AudioOutput.h"
#include "AudioInput.h"
#include "lvgl/lvgl.h"
#include "lv_drivers/display/fbdev.h"
#include "lv_drivers/indev/evdev.h"
#include "devices.h"
#include "gui_top_bar.h"
#include "gui_tx.h"
#include "gui_rx.h"
#include "gui_agc.h"
#include "gui_bar.h"
#include "ble_interface.h"
#include "vfo.h"
#include "sdrstream.h"
#include "gui_vfo.h"
#include "Settings.h"
#include "Gui_band.h"
#include "Keyboard.h"
#include "Filter.h"
#include "FmDecode.h"
#include "Waterfall.h"
#include "AMDemodulator.h"
#include "AMmodulator.h"
#include "MidiControle.h"
const int mode_lsb = 1;
const int mode_usb = 2;
const int mode_am = 3;
const int mode_dsb = 4;
const int mode_cw = 5;
const int mode_ft8 = 6;
const int mode_ft4 = 7;
const int mode_broadband_fm = 8;
const int mode_narrowband_fm = 9;
const int mode_rtty = 10;
extern int mode;
extern volatile int filter;
extern std::mutex am_finish;
extern std::mutex am_tx_finish;
extern std::mutex fm_finish;
extern std::mutex stream_finish;
extern atomic_bool stop_flag;
extern atomic_bool stop_tx_flag;
extern atomic_bool stop_txmod_flag;
//double freq = 89950000;
extern double ifrate;
extern double ifrate_tx;
/** Compute mean and RMS over a sample vector. */
inline void samples_mean_rms(const SampleVector& samples,
double& mean, double& rms)
{
Sample vsum = 0;
Sample vsumsq = 0;
unsigned int n = samples.size();
for (unsigned int i = 0; i < n; i++) {
Sample v = samples[i];
vsum += v;
vsumsq += v * v;
}
mean = vsum / n;
rms = sqrt(vsumsq / n);
}
void select_filter(int ifilter);
void select_mode(int s_mode, bool bvfo = true);
void select_mode_tx(int s_mode, int tone = 0);