29enum class LinkwitzRileyFilterType
47template <
typename SampleType>
52 using Type = LinkwitzRileyFilterType;
81 template <
typename ProcessContext>
84 const auto& inputBlock = context.getInputBlock();
85 auto& outputBlock = context.getOutputBlock();
86 const auto numChannels = outputBlock.getNumChannels();
87 const auto numSamples = outputBlock.getNumSamples();
90 jassert (inputBlock.getNumChannels() == numChannels);
91 jassert (inputBlock.getNumSamples() == numSamples);
93 if (context.isBypassed)
95 outputBlock.copyFrom (inputBlock);
99 for (
size_t channel = 0; channel < numChannels; ++channel)
101 auto*
inputSamples = inputBlock.getChannelPointer (channel);
102 auto*
outputSamples = outputBlock.getChannelPointer (channel);
104 for (
size_t i = 0; i < numSamples; ++i)
108 #if JUCE_DSP_ENABLE_SNAP_TO_ZERO
133 std::vector<SampleType> s1, s2, s3, s4;
135 double sampleRate = 44100.0;
136 SampleType cutoffFrequency = 2000.0;
137 Type filterType = Type::lowpass;
A filter class designed to perform multi-band separation using the TPT (Topology-Preserving Transform...
void prepare(const ProcessSpec &spec)
Initialises the filter.
void setType(Type newType)
Sets the filter type.
void process(const ProcessContext &context) noexcept
Processes the input and output samples supplied in the processing context.
void reset()
Resets the internal state variables of the filter.
LinkwitzRileyFilter()
Constructor.
SampleType getCutoffFrequency() const noexcept
Returns the cutoff frequency of the filter.
SampleType processSample(int channel, SampleType inputValue)
Performs the filter operation on a single sample at a time.
void setCutoffFrequency(SampleType newCutoffFrequencyHz)
Sets the cutoff frequency of the filter in Hz.
Type getType() const noexcept
Returns the type of the filter.
void snapToZero() noexcept
Ensure that the state variables are rounded to zero if the state variables are denormals.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
This structure is passed into a DSP algorithm's prepare() method, and contains information about vari...