34 if (length == 0)
return;
36 int nFilt =
m_ord + 1;
37 int nFact = 3 * (nFilt - 1);
38 int nExt = length + 2 * nFact;
40 double *filtScratchIn =
new double[ nExt ];
41 double *filtScratchOut =
new double[ nExt ];
43 for (i = 0; i < nExt; i++) {
44 filtScratchIn[ i ] = 0.0;
45 filtScratchOut[ i ] = 0.0;
49 double sample0 = 2 * src[ 0 ];
50 double sampleN = 2 * src[ length - 1 ];
53 for (i = nFact; i > 0; i--) {
55 filtScratchIn[index] = sample0 - src[ i ];
60 for (i = 0; i < nFact; i++) {
62 filtScratchIn[(nExt - nFact) + index] =
63 sampleN - src[ (length - 2) - i ];
68 for (i = 0; i < length; i++) {
69 filtScratchIn[ i + nFact ] = src[ i ];
77 for (i = 0; i < nExt; i++) {
78 filtScratchIn[ i ] = filtScratchOut[ nExt - i - 1];
88 for (i = 0; i < length; i++) {
89 dst[ i ] = filtScratchOut[ nExt - nFact - i - 1 ];
92 delete [] filtScratchIn;
93 delete [] filtScratchOut;
void process(const double *const QM_R__ in, double *const QM_R__ out, const int n)
Filter the input sequence.
void process(const double *const QM_R__ src, double *const QM_R__ dst, const int length)
FiltFilt(Filter::Parameters)