-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.cc.in
44 lines (33 loc) · 1.13 KB
/
test.cc.in
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
#include "svf-VERSION.h"
#include <vector>
#include <iostream>
int main()
{
svf_VERSION::lowpass lp;
svf_VERSION::bandpass bp;
svf_VERSION::highpass hp;
svf_VERSION::lowbandhighpass lbhp;
std::vector<float> input(1000);
float phase = 0;
for (size_t index = 0; index < 1000; ++index)
{
if (phase < M_PI) input[index] = 1.0;
else input[index] = -1.0;
phase += 0.01;
phase = fmodf(phase, 2 * M_PI);
}
std::vector<float> output(1000);
lp.process(&input[0], &output[0], 1000, 1.0, 0.01, 0.5);
for (size_t index = 0; index < 1000; ++index) std::cout << output[index] << "\n";
std::cout << "\n";
hp.process(&input[0], &output[0], 1000, 1.0, 0.01, 0.5);
for (size_t index = 0; index < 1000; ++index) std::cout << output[index] << "\n";
std::cout << "\n";
bp.process(&input[0], &output[0], 1000, 1.0, 0.01, 0.5);
for (size_t index = 0; index < 1000; ++index) std::cout << output[index] << "\n";
std::cout << "\n";
lbhp.process(&input[0], &output[0], 1000, 0.5, 1.0, 0.5, 0.01, 0.5);
for (size_t index = 0; index < 1000; ++index) std::cout << output[index] << "\n";
std::cout << "\n";
return 0;
}