Nsound
0.9.4
|
A class for filtering audio in the frequecy domain. More...
#include <Nsound/FilterLowPassIIR.h>
Public Types | |
enum | Type { LOW_PASS, HIGH_PASS } |
Public Member Functions | |
FilterLowPassIIR (const float64 &sample_rate, uint32 n_poles, const float64 &frequency, const float64 &percent_ripple=0.0) | |
AudioStream | filter (const AudioStream &x) |
AudioStream | filter (const AudioStream &x, const float64 &frequency) |
AudioStream | filter (const AudioStream &x, const Buffer &frequencies) |
Buffer | filter (const Buffer &x) |
Buffer | filter (const Buffer &x, const float64 &frequency) |
Buffer | filter (const Buffer &x, const Buffer &frequencies) |
float64 | filter (const float64 &x) |
float64 | filter (const float64 &x, const float64 &frequency) |
float64 | getFrequency () const |
void | plot (boolean show_fc=true, boolean show_phase=false) |
void | reset () |
void | setCutoff (const float64 &fc) |
Sets the cut off frequency (Hz). More... | |
void | setRealtime (bool flag) |
Buffer | getFrequencyAxis (const uint32 n_fft=8192) |
Buffer | getFrequencyResponse (const uint32 n_fft=8192) |
Buffer | getImpulseResponse (const uint32 n_samples=8192) |
virtual uint32 | getKernelSize () const |
Buffer | getPhaseResponse () |
float64 | getSampleRate () const |
void | plot (boolean show_phase=false) |
Protected Types | |
typedef std::set< Kernel > | KernelCache |
Protected Member Functions | |
void | makeKernel (const float64 &frequency) |
void | makeIIRKernelHelper (const float64 &frequency, float64 *a, float64 *b, uint32 p) |
Protected Attributes | |
Type | type_ |
uint32 | n_poles_ |
float64 | frequency_ |
float64 | percent_ripple_ |
float64 * | a_ |
float64 * | b_ |
float64 * | x_history_ |
float64 * | x_ptr_ |
float64 * | x_end_ptr_ |
float64 * | y_history_ |
float64 * | y_ptr_ |
float64 * | y_end_ptr_ |
KernelCache | kernel_cache_ |
float64 | sample_rate_ |
float64 | two_pi_over_sample_rate_ |
float64 | sample_time_ |
uint32 | kernel_size_ |
bool | is_realtime_ |
A class for filtering audio in the frequecy domain.
Definition at line 47 of file FilterLowPassIIR.h.
|
protectedinherited |
Definition at line 141 of file FilterStageIIR.h.
|
inherited |
FilterLowPassIIR::FilterLowPassIIR | ( | const float64 & | sample_rate, |
uint32 | n_poles, | ||
const float64 & | frequency, | ||
const float64 & | percent_ripple = 0.0 |
||
) |
Definition at line 42 of file FilterLowPassIIR.cc.
References Nsound::FilterStageIIR::frequency_, and Nsound::Filter::kernel_size_.
AudioStream FilterLowPassIIR::filter | ( | const AudioStream & | x | ) |
Definition at line 61 of file FilterLowPassIIR.cc.
References Nsound::Filter::filter().
Referenced by Nsound::FilterBandPassIIR::filter(), Nsound::FilterBandRejectIIR::filter(), main(), Nsound::Clarinet::play(), and Nsound::DrumBD01::play().
AudioStream FilterLowPassIIR::filter | ( | const AudioStream & | x, |
const float64 & | frequency | ||
) |
Definition at line 68 of file FilterLowPassIIR.cc.
References Nsound::FilterStageIIR::filter().
AudioStream FilterLowPassIIR::filter | ( | const AudioStream & | x, |
const Buffer & | frequencies | ||
) |
Definition at line 90 of file FilterLowPassIIR.cc.
References Nsound::FilterStageIIR::filter().
Implements Nsound::Filter.
Definition at line 104 of file FilterLowPassIIR.cc.
References Nsound::FilterStageIIR::filter().
Implements Nsound::Filter.
Definition at line 111 of file FilterLowPassIIR.cc.
References Nsound::FilterStageIIR::filter().
|
inline |
Definition at line 82 of file FilterLowPassIIR.h.
References Nsound::FilterStageIIR::frequency_.
Referenced by Nsound::FilterBandPassIIR::getFrequencyHigh(), Nsound::FilterBandRejectIIR::getFrequencyLow(), Nsound::FilterBandRejectIIR::plot(), and Nsound::FilterBandPassIIR::plot().
Definition at line 125 of file FilterLowPassIIR.cc.
References Nsound::Plotter::axvline(), Nsound::FilterStageIIR::frequency_, Nsound::FilterStageIIR::n_poles_, Nsound::Filter::plot(), Nsound::Filter::sample_rate_, Nsound::Plotter::subplot(), and Nsound::Plotter::title().
Referenced by main().
|
virtual |
Implements Nsound::Filter.
Definition at line 157 of file FilterLowPassIIR.cc.
References Nsound::FilterStageIIR::reset().
Referenced by Nsound::FilterBandPassIIR::reset(), and Nsound::FilterBandRejectIIR::reset().
void FilterLowPassIIR::setCutoff | ( | const float64 & | fc | ) |
Sets the cut off frequency (Hz).
Definition at line 164 of file FilterLowPassIIR.cc.
References Nsound::FilterStageIIR::frequency_, makeKernel(), and Nsound::Filter::sample_rate_.
|
protected |
Definition at line 118 of file FilterLowPassIIR.cc.
References Nsound::FilterStageIIR::makeKernel().
Referenced by setCutoff().
|
protectedinherited |
Definition at line 474 of file FilterStageIIR.cc.
References Nsound::FilterStageIIR::HIGH_PASS, Nsound::FilterStageIIR::LOW_PASS, M_PI, Nsound::FilterStageIIR::n_poles_, Nsound::FilterStageIIR::percent_ripple_, Nsound::Filter::sample_rate_, and Nsound::FilterStageIIR::type_.
Referenced by Nsound::FilterStageIIR::makeKernel().
|
inlineinherited |
Definition at line 185 of file Filter.cc.
References Nsound::FFTransform::roundUp2(), and Nsound::Filter::sample_rate_.
Referenced by main(), Nsound::Filter::plot(), and Nsound::FilterIIR::savePlot().
Definition at line 210 of file Filter.cc.
References Nsound::FFTransform::fft(), Nsound::Filter::getImpulseResponse(), and Nsound::Filter::sample_rate_.
Referenced by Nsound::FilterBandPassIIR::FilterBandPassIIR(), FilterLeastSquaresFIR_UnitTest(), Nsound::FilterIIR::getRMS(), main(), Nsound::Filter::plot(), and Nsound::FilterIIR::savePlot().
Definition at line 225 of file Filter.cc.
References Nsound::Filter::filter(), Nsound::Filter::is_realtime_, and Nsound::Filter::reset().
Referenced by Nsound::Filter::getFrequencyResponse(), Nsound::FilterHighPassFIR::getImpulseResponse(), Nsound::FilterLowPassFIR::getImpulseResponse(), Nsound::FilterLeastSquaresFIR::getImpulseResponse(), Nsound::FilterIIR::getImpulseResponse(), and Nsound::Filter::getPhaseResponse().
|
inlinevirtualinherited |
Reimplemented in Nsound::FilterIIR, and Nsound::FilterTone.
Definition at line 96 of file Filter.h.
References Nsound::Filter::kernel_size_.
Referenced by Nsound::FilterBandPassIIR::FilterBandPassIIR(), Nsound::FilterBandPassFIR::plot(), Nsound::FilterBandPassIIR::plot(), and Nsound::FilterBandRejectIIR::plot().
|
inherited |
Definition at line 245 of file Filter.cc.
References Nsound::FFTransform::fft(), Nsound::Filter::getImpulseResponse(), Nsound::Buffer::getLength(), Nsound::Filter::sample_rate_, and Nsound::Buffer::subbuffer().
Referenced by Nsound::Filter::plot().
|
inlineinherited |
|
inherited |
Definition at line 262 of file Filter.cc.
References Nsound::Plotter::figure(), Nsound::Buffer::getdB(), Nsound::Filter::getFrequencyAxis(), Nsound::Filter::getFrequencyResponse(), Nsound::Buffer::getMax(), Nsound::Filter::getPhaseResponse(), Nsound::Plotter::plot(), Nsound::Plotter::subplot(), Nsound::Plotter::xlabel(), Nsound::Plotter::ylabel(), and Nsound::Plotter::ylim().
Referenced by main(), Nsound::FilterLowPassMoogVcf::plot(), Nsound::FilterPhaser::plot(), Nsound::FilterTone::plot(), Nsound::FilterHighPassIIR::plot(), Nsound::FilterCombLowPassFeedback::plot(), plot(), Nsound::FilterLowPassFIR::plot(), Nsound::FilterHighPassFIR::plot(), Nsound::FilterAllPass::plot(), Nsound::FilterBandPassVocoder::plot(), Nsound::FilterBandPassFIR::plot(), Nsound::FilterLeastSquaresFIR::plot(), Nsound::FilterFlanger::plot(), Nsound::FilterBandRejectFIR::plot(), Nsound::FilterBandRejectIIR::plot(), Nsound::FilterBandPassIIR::plot(), and Nsound::FilterParametricEqualizer::plot().
|
protectedinherited |
Definition at line 112 of file FilterStageIIR.h.
Referenced by Nsound::FilterStageIIR::makeIIRKernelHelper(), Nsound::FilterStageIIR::makeKernel(), and Nsound::FilterStageIIR::operator=().
|
protectedinherited |
Definition at line 113 of file FilterStageIIR.h.
Referenced by Nsound::FilterStageIIR::filter(), Nsound::FilterStageIIR::FilterStageIIR(), Nsound::FilterStageIIR::makeIIRKernelHelper(), Nsound::FilterStageIIR::makeKernel(), Nsound::FilterStageIIR::operator=(), Nsound::FilterHighPassIIR::plot(), plot(), and Nsound::FilterStageIIR::reset().
|
protectedinherited |
Definition at line 114 of file FilterStageIIR.h.
Referenced by Nsound::FilterHighPassIIR::FilterHighPassIIR(), FilterLowPassIIR(), Nsound::FilterHighPassIIR::getFrequency(), getFrequency(), Nsound::FilterStageIIR::Kernel::operator<(), Nsound::FilterStageIIR::operator=(), Nsound::FilterHighPassIIR::plot(), plot(), Nsound::FilterStageIIR::reset(), and setCutoff().
|
protectedinherited |
Definition at line 115 of file FilterStageIIR.h.
Referenced by Nsound::FilterStageIIR::makeIIRKernelHelper(), and Nsound::FilterStageIIR::operator=().
|
protectedinherited |
Definition at line 117 of file FilterStageIIR.h.
Referenced by Nsound::FilterStageIIR::filter(), and Nsound::FilterStageIIR::makeKernel().
|
protectedinherited |
Definition at line 118 of file FilterStageIIR.h.
Referenced by Nsound::FilterStageIIR::filter(), and Nsound::FilterStageIIR::makeKernel().
|
protectedinherited |
Definition at line 120 of file FilterStageIIR.h.
Referenced by Nsound::FilterStageIIR::filter(), Nsound::FilterStageIIR::FilterStageIIR(), Nsound::FilterStageIIR::operator=(), Nsound::FilterStageIIR::reset(), and Nsound::FilterStageIIR::~FilterStageIIR().
|
protectedinherited |
Definition at line 121 of file FilterStageIIR.h.
Referenced by Nsound::FilterStageIIR::filter(), Nsound::FilterStageIIR::FilterStageIIR(), Nsound::FilterStageIIR::operator=(), and Nsound::FilterStageIIR::reset().
|
protectedinherited |
Definition at line 122 of file FilterStageIIR.h.
Referenced by Nsound::FilterStageIIR::filter(), Nsound::FilterStageIIR::FilterStageIIR(), and Nsound::FilterStageIIR::operator=().
|
protectedinherited |
Definition at line 124 of file FilterStageIIR.h.
Referenced by Nsound::FilterStageIIR::filter(), Nsound::FilterStageIIR::FilterStageIIR(), Nsound::FilterStageIIR::operator=(), Nsound::FilterStageIIR::reset(), and Nsound::FilterStageIIR::~FilterStageIIR().
|
protectedinherited |
Definition at line 125 of file FilterStageIIR.h.
Referenced by Nsound::FilterStageIIR::filter(), Nsound::FilterStageIIR::FilterStageIIR(), Nsound::FilterStageIIR::operator=(), and Nsound::FilterStageIIR::reset().
|
protectedinherited |
Definition at line 126 of file FilterStageIIR.h.
Referenced by Nsound::FilterStageIIR::filter(), Nsound::FilterStageIIR::FilterStageIIR(), and Nsound::FilterStageIIR::operator=().
|
protectedinherited |
Definition at line 143 of file FilterStageIIR.h.
Referenced by Nsound::FilterStageIIR::makeKernel(), Nsound::FilterStageIIR::operator=(), and Nsound::FilterStageIIR::~FilterStageIIR().
|
protectedinherited |
Definition at line 113 of file Filter.h.
Referenced by Nsound::FilterPhaser::filter(), Nsound::FilterCombLowPassFeedback::filter(), Nsound::FilterDelay::filter(), Nsound::FilterAllPass::FilterAllPass(), Nsound::FilterCombLowPassFeedback::FilterCombLowPassFeedback(), Nsound::FilterDelay::FilterDelay(), Nsound::FilterFlanger::FilterFlanger(), Nsound::FilterPhaser::FilterPhaser(), Nsound::FilterSlinky::FilterSlinky(), Nsound::Filter::getFrequencyAxis(), Nsound::Filter::getFrequencyResponse(), Nsound::Filter::getPhaseResponse(), Nsound::Filter::getSampleRate(), Nsound::FilterStageIIR::makeIIRKernelHelper(), Nsound::FilterHighPassFIR::makeKernel(), Nsound::FilterStageIIR::makeKernel(), Nsound::FilterBandPassVocoder::makeKernel(), Nsound::FilterLeastSquaresFIR::makeKernel(), Nsound::FilterParametricEqualizer::makeKernel(), Nsound::FilterPhaser::operator=(), Nsound::FilterLeastSquaresFIR::operator=(), Nsound::FilterFlanger::operator=(), Nsound::FilterIIR::operator=(), Nsound::FilterLowPassMoogVcf::plot(), Nsound::FilterPhaser::plot(), Nsound::FilterTone::plot(), Nsound::FilterHighPassIIR::plot(), Nsound::FilterCombLowPassFeedback::plot(), plot(), Nsound::FilterLowPassFIR::plot(), Nsound::FilterAllPass::plot(), Nsound::FilterHighPassFIR::plot(), Nsound::FilterBandPassFIR::plot(), Nsound::FilterLeastSquaresFIR::plot(), Nsound::FilterFlanger::plot(), Nsound::FilterBandRejectFIR::plot(), Nsound::FilterBandPassIIR::plot(), Nsound::FilterBandRejectIIR::plot(), Nsound::FilterParametricEqualizer::plot(), setCutoff(), and Nsound::FilterLeastSquaresFIR::setWindow().
|
protectedinherited |
Definition at line 114 of file Filter.h.
Referenced by Nsound::FilterTone::makeKernel(), Nsound::FilterLowPassFIR::makeKernel(), and Nsound::FilterParametricEqualizer::makeKernel().
|
protectedinherited |
Definition at line 115 of file Filter.h.
Referenced by Nsound::FilterLowPassMoogVcf::_make_filter().
|
protectedinherited |
Definition at line 116 of file Filter.h.
Referenced by Nsound::FilterLowPassFIR::filter(), Nsound::FilterLeastSquaresFIR::filter(), Nsound::FilterBandPassFIR::FilterBandPassFIR(), Nsound::FilterBandPassIIR::FilterBandPassIIR(), Nsound::FilterBandRejectIIR::FilterBandRejectIIR(), Nsound::FilterHighPassIIR::FilterHighPassIIR(), Nsound::FilterLeastSquaresFIR::FilterLeastSquaresFIR(), Nsound::FilterLowPassFIR::FilterLowPassFIR(), FilterLowPassIIR(), Nsound::FilterLeastSquaresFIR::getKernel(), Nsound::Filter::getKernelSize(), Nsound::FilterHighPassFIR::makeKernel(), Nsound::FilterLowPassFIR::makeKernel(), Nsound::FilterBandRejectFIR::makeKernel(), Nsound::FilterLeastSquaresFIR::makeKernel(), Nsound::FilterLeastSquaresFIR::operator=(), Nsound::FilterLowPassFIR::plot(), Nsound::FilterHighPassFIR::plot(), Nsound::FilterLeastSquaresFIR::plot(), Nsound::FilterBandRejectFIR::plot(), Nsound::FilterLowPassFIR::reset(), Nsound::FilterHighPassFIR::reset(), Nsound::FilterLeastSquaresFIR::reset(), Nsound::FilterLeastSquaresFIR::setKernel(), Nsound::FilterLeastSquaresFIR::setWindow(), and Nsound::FilterHighPassFIR::spectraReversal_().
|
protectedinherited |
Definition at line 118 of file Filter.h.
Referenced by Nsound::Filter::filter(), Nsound::FilterBandRejectIIR::filter(), Nsound::FilterBandRejectFIR::filter(), Nsound::Filter::getImpulseResponse(), and Nsound::Filter::setRealtime().