-
Notifications
You must be signed in to change notification settings - Fork 4
/
util.h
30 lines (26 loc) · 1.3 KB
/
util.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
#ifndef UTIL_H
#define UTIL_H
#include <vector>
#include <complex>
double now();
void writewav(const std::vector<double> &samples, const char *filename, int rate);
std::vector<double> readwav(const char *filename, int &rate_out);
void writetxt(std::vector<double> v, const char *filename);
std::complex<double> goertzel(std::vector<double> v, int rate, int i0, int n, double hz);
double vmax(const std::vector<double> &v);
std::vector<double> vreal(const std::vector<std::complex<double>> &a);
std::vector<double> vimag(const std::vector<std::complex<double>> &a);
std::vector<std::complex<double>> gfsk_c(const std::vector<int> &symbols,
double hz0, double hz1,
double spacing, int rate, int symsamples,
double phase0,
const std::vector<double> &gwin);
std::vector<double> gfsk_r(const std::vector<int> &symbols,
double hz0, double hz1,
double spacing, int rate, int symsamples,
double phase0,
const std::vector<double> &gwin);
std::vector<double> gfsk_window(int samples_per_symbol, double b);
typedef unsigned long ulong;
typedef unsigned int uint;
#endif