mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added a couple of assertions in IIR::Coefficients
This commit is contained in:
parent
efacd83ab5
commit
e0c079c448
1 changed files with 3 additions and 0 deletions
|
|
@ -331,6 +331,7 @@ typename IIR::Coefficients<NumericType>::Ptr IIR::Coefficients<NumericType>::mak
|
|||
jassert (sampleRate > 0);
|
||||
jassert (frequency > 0 && frequency <= static_cast<NumericType> (sampleRate * 0.5));
|
||||
jassert (Q > 0);
|
||||
jassert (gainFactor > 0);
|
||||
|
||||
auto A = jmax (static_cast<NumericType> (0.0), std::sqrt (gainFactor));
|
||||
auto omega = (2 * MathConstants<NumericType>::pi * jmax (frequency, static_cast<NumericType> (2.0))) / static_cast<NumericType> (sampleRate);
|
||||
|
|
@ -451,6 +452,8 @@ template <typename NumericType>
|
|||
void IIR::Coefficients<NumericType>::getPhaseForFrequencyArray (double* frequencies, double* phases,
|
||||
size_t numSamples, double sampleRate) const noexcept
|
||||
{
|
||||
jassert (sampleRate > 0);
|
||||
|
||||
constexpr Complex<double> j (0, 1);
|
||||
const auto order = getFilterOrder();
|
||||
const auto* coefs = coefficients.begin();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue