-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (27 loc) · 756 Bytes
/
Copy pathmain.cpp
File metadata and controls
35 lines (27 loc) · 756 Bytes
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
//
// Created by busygin on 11/16/16.
//
#include <iostream>
#include <vector>
#include "butter.h"
int main() {
size_t N;
double Wn;
while (true) {
std::cout << "Input Butterworth highpass filter order and cutoff frequency (as fraction of Nyquist): ";
std::cin >> N >> Wn;
if (N==0) break;
std::vector<double> b;
std::vector<double> a;
highpass_butter(N, Wn, b, a);
std::cout << " b = [";
for (std::vector<double>::const_iterator pb = b.begin(); pb != b.end(); ++pb)
std::cout << ' ' << *pb;
std::cout << " ]\n";
std::cout << " a[1:] = [";
for (std::vector<double>::const_iterator pa = a.begin(); pa != a.end(); ++pa)
std::cout << ' ' << *pa;
std::cout << " ]\n";
}
return 0;
}