Mercurial > hg > qm-dsp
comparison dsp/signalconditioning/FiltFilt.cpp @ 508:855d862cf02b
Small simplification
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Wed, 05 Jun 2019 16:05:09 +0100 |
parents | d7b9691817a3 |
children |
comparison
equal
deleted
inserted
replaced
507:d7b9691817a3 | 508:855d862cf02b |
---|---|
63 sampleN - src[ (length - 2) - i ]; | 63 sampleN - src[ (length - 2) - i ]; |
64 } | 64 } |
65 ++index; | 65 ++index; |
66 } | 66 } |
67 | 67 |
68 index = 0; | |
69 for (i = 0; i < length; i++) { | 68 for (i = 0; i < length; i++) { |
70 filtScratchIn[ i + nFact ] = src[ i ]; | 69 filtScratchIn[ i + nFact ] = src[ i ]; |
71 } | 70 } |
72 | 71 |
73 //////////////////////////////// | 72 //////////////////////////////// |
83 m_filter.reset(); | 82 m_filter.reset(); |
84 | 83 |
85 // do FILTER again | 84 // do FILTER again |
86 m_filter.process(filtScratchIn, filtScratchOut, nExt); | 85 m_filter.process(filtScratchIn, filtScratchOut, nExt); |
87 | 86 |
88 // reverse the series back | 87 // reverse the series to output |
89 for (i = 0; i < nExt; i++) { | 88 for (i = 0; i < length; i++) { |
90 filtScratchIn[ i ] = filtScratchOut[ nExt - i - 1 ]; | 89 dst[ i ] = filtScratchOut[ nExt - nFact - i - 1 ]; |
91 } | 90 } |
92 for (i = 0; i < nExt; i++) { | |
93 filtScratchOut[ i ] = filtScratchIn[ i ]; | |
94 } | |
95 | |
96 index = 0; | |
97 for (i = 0; i < length; i++) { | |
98 dst[ index++ ] = filtScratchOut[ i + nFact ]; | |
99 } | |
100 | 91 |
101 delete [] filtScratchIn; | 92 delete [] filtScratchIn; |
102 delete [] filtScratchOut; | 93 delete [] filtScratchOut; |
103 } | 94 } |
104 | 95 |