1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +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 a6b128affb
commit d3e4d9cc56
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

@ -60,7 +60,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();
@ -72,7 +72,7 @@ void Filter<SampleType>::reset()
}
for (size_t i = 0; i < order; ++i)
state[i] = SampleType {0};
state[i] = resetToValue;
}
template <typename SampleType>