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:
parent
2a274f70b2
commit
048f319c38
2 changed files with 9 additions and 3 deletions
|
|
@ -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. */
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue