Line | |
---|
1 | #include <vector>
|
---|
2 |
|
---|
3 | #ifndef FAD_MAX_SAMPLES
|
---|
4 | #warning FAD_MAX_SAMPLES not defined. defining: FAD_MAX_SAMPLES to 1024
|
---|
5 | #define FAD_MAX_SAMPLES 1024
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | // source vector is
|
---|
9 | // float Ameas[FAD_MAX_SAMPLES];
|
---|
10 | void factfir(double b, vector<double> &a, int k, vector<float> &source, vector<float> &dest){
|
---|
11 | //dest.clear();
|
---|
12 |
|
---|
13 | for (int slice =0; slice < FAD_MAX_SAMPLES; slice++) {
|
---|
14 | float currentval = 0;
|
---|
15 |
|
---|
16 | for (int i=0; i < k ; i++){
|
---|
17 | currentval += a[i] * source[ (slice - i + FAD_MAX_SAMPLES) % FAD_MAX_SAMPLES ];
|
---|
18 | }
|
---|
19 | dest[slice] = currentval / b;
|
---|
20 | }
|
---|
21 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.