1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00

DSP: Added a second reset method to flush the IIR filter to a specific value

This commit is contained in:
hogliux 2017-07-31 15:51:21 +01:00
parent 2a274f70b2
commit 048f319c38
2 changed files with 9 additions and 3 deletions

View file

@ -86,7 +86,13 @@ namespace IIR
Note that this clears the processing state, but the type of filter and
its coefficients aren't changed.
*/
void reset();
void reset() { reset (SampleType {0}); }
/** Resets the filter's processing pipeline to a specific value.
See @reset
*/
void reset (SampleType resetToValue);
//==============================================================================
/** Called before processing starts. */

View file

@ -61,7 +61,7 @@ Filter<SampleType>::Filter (Coefficients<typename Filter<SampleType>::NumericTyp
}
template <typename SampleType>
void Filter<SampleType>::reset()
void Filter<SampleType>::reset (SampleType resetToValue)
{
auto newOrder = coefficients->getFilterOrder();
@ -73,7 +73,7 @@ void Filter<SampleType>::reset()
}
for (size_t i = 0; i < order; ++i)
state[i] = SampleType {0};
state[i] = resetToValue;
}
template <typename SampleType>