Nsound
0.9.4
|
#include <Nsound/FilterBandRejectFIR.h>
Classes | |
struct | Kernel |
A class to store calculated kernels. More... | |
Public Member Functions | |
FilterBandRejectFIR (const float64 &sample_rate, uint32 kernel_size, const float64 &frequency_Hz_low, const float64 &frequency_Hz_high) | |
virtual | ~FilterBandRejectFIR () |
float64 | getFrequencyLow () const |
float64 | getFrequencyHigh () const |
AudioStream | filter (const AudioStream &x) |
AudioStream | filter (const AudioStream &x, const float64 &f_low, const float64 &f_high) |
AudioStream | filter (const AudioStream &x, const Buffer &low_frequencies, const Buffer &high_frequencies) |
Buffer | filter (const Buffer &x) |
Buffer | filter (const Buffer &x, const float64 &f_low, const float64 &f_high) |
Buffer | filter (const Buffer &x, const Buffer &frequencies_Hz_low, const Buffer &frequencies_Hz_high) |
virtual float64 | filter (const float64 &x) |
virtual float64 | filter (const float64 &x, const float64 &frequency_Hz) |
virtual float64 | filter (const float64 &x, const float64 &frequency_Hz_low, const float64 &frequency_Hz_high) |
void | makeKernel (const float64 &frequency_Hz_low, const float64 &frequency_Hz_high) |
void | plot (boolean show_fc=true, boolean show_phase=false) |
void | reset () |
AudioStream | filter (const AudioStream &x, const float64 &frequency) |
AudioStream | filter (const AudioStream &x, const Buffer &frequencies) |
Buffer | filter (const Buffer &x, const float64 &frequency) |
Buffer | filter (const Buffer &x, const Buffer &frequencies) |
float64 | getFrequency () const |
Buffer | getImpulseResponse () |
Buffer | getImpulseResponse (const uint32 n_samples=8192) |
void | makeKernel (const float64 &frequency) |
void | plot (boolean show_phase=false) |
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) |
virtual uint32 | getKernelSize () const |
Buffer | getPhaseResponse () |
float64 | getSampleRate () const |
Protected Types | |
typedef std::set< Kernel > | KernelCache |
Protected Member Functions | |
void | spectraReversal_ () |
Private Member Functions | |
FilterBandRejectFIR (const FilterBandRejectFIR ©) | |
FilterBandRejectFIR & | operator= (const FilterBandRejectFIR &rhs) |
Definition at line 47 of file FilterBandRejectFIR.h.
|
protected |
Definition at line 146 of file FilterBandRejectFIR.h.
FilterBandRejectFIR::FilterBandRejectFIR | ( | const float64 & | sample_rate, |
uint32 | kernel_size, | ||
const float64 & | frequency_Hz_low, | ||
const float64 & | frequency_Hz_high | ||
) |
Definition at line 47 of file FilterBandRejectFIR.cc.
References Nsound::FilterLowPassFIR::frequency_1_Hz_, and reset().
|
virtual |
Definition at line 63 of file FilterBandRejectFIR.cc.
References kernel_cache_.
|
inlineprivate |
Definition at line 152 of file FilterBandRejectFIR.h.
float64 FilterBandRejectFIR::getFrequencyLow | ( | ) | const |
Definition at line 80 of file FilterBandRejectFIR.cc.
References Nsound::FilterLowPassFIR::frequency_1_Hz_.
float64 FilterBandRejectFIR::getFrequencyHigh | ( | ) | const |
Definition at line 87 of file FilterBandRejectFIR.cc.
References frequency_2_Hz_.
AudioStream FilterBandRejectFIR::filter | ( | const AudioStream & | x | ) |
Definition at line 95 of file FilterBandRejectFIR.cc.
References Nsound::Filter::filter().
Referenced by filter(), and main().
AudioStream FilterBandRejectFIR::filter | ( | const AudioStream & | x, |
const float64 & | f_low, | ||
const float64 & | f_high | ||
) |
Definition at line 102 of file FilterBandRejectFIR.cc.
References filter(), Nsound::AudioStream::getNChannels(), and Nsound::AudioStream::getSampleRate().
AudioStream FilterBandRejectFIR::filter | ( | const AudioStream & | x, |
const Buffer & | low_frequencies, | ||
const Buffer & | high_frequencies | ||
) |
Definition at line 121 of file FilterBandRejectFIR.cc.
References filter(), Nsound::AudioStream::getNChannels(), Nsound::AudioStream::getSampleRate(), Nsound::Filter::is_realtime_, and reset().
Definition at line 145 of file FilterBandRejectFIR.cc.
References Nsound::FilterLowPassFIR::filter().
Buffer FilterBandRejectFIR::filter | ( | const Buffer & | x, |
const float64 & | f_low, | ||
const float64 & | f_high | ||
) |
Definition at line 152 of file FilterBandRejectFIR.cc.
References Nsound::Buffer::begin(), Nsound::Buffer::end(), Nsound::FilterLowPassFIR::filter(), Nsound::Buffer::getLength(), Nsound::Filter::is_realtime_, makeKernel(), and reset().
Buffer FilterBandRejectFIR::filter | ( | const Buffer & | x, |
const Buffer & | frequencies_Hz_low, | ||
const Buffer & | frequencies_Hz_high | ||
) |
Definition at line 179 of file FilterBandRejectFIR.cc.
References filter(), Nsound::Buffer::getLength(), Nsound::Filter::is_realtime_, and reset().
Reimplemented from Nsound::FilterHighPassFIR.
Definition at line 206 of file FilterBandRejectFIR.cc.
References Nsound::FilterLowPassFIR::filter().
Reimplemented from Nsound::FilterHighPassFIR.
Definition at line 213 of file FilterBandRejectFIR.cc.
References Nsound::FilterLowPassFIR::filter().
|
virtual |
Definition at line 220 of file FilterBandRejectFIR.cc.
References Nsound::FilterLowPassFIR::filter(), and makeKernel().
void FilterBandRejectFIR::makeKernel | ( | const float64 & | frequency_Hz_low, |
const float64 & | frequency_Hz_high | ||
) |
Definition at line 231 of file FilterBandRejectFIR.cc.
References Nsound::FilterLowPassFIR::b_, Nsound::FilterBandRejectFIR::Kernel::b_, kernel_cache_, Nsound::Filter::kernel_size_, Nsound::FilterHighPassFIR::makeKernel(), and Nsound::FilterLowPassFIR::makeKernel().
Referenced by filter(), and reset().
Definition at line 321 of file FilterBandRejectFIR.cc.
References Nsound::Plotter::axvline(), Nsound::FilterLowPassFIR::frequency_1_Hz_, frequency_2_Hz_, Nsound::Filter::kernel_size_, Nsound::Filter::plot(), Nsound::Filter::sample_rate_, Nsound::Plotter::subplot(), and Nsound::Plotter::title().
Referenced by main().
|
virtual |
Resets interal history buffer and sets the cut off frequency to the one used at declaration.
Reimplemented from Nsound::FilterHighPassFIR.
Definition at line 356 of file FilterBandRejectFIR.cc.
References Nsound::FilterLowPassFIR::frequency_1_Hz_, frequency_2_Hz_, makeKernel(), and Nsound::FilterLowPassFIR::reset().
Referenced by filter(), and FilterBandRejectFIR().
|
inlineprivate |
Definition at line 159 of file FilterBandRejectFIR.h.
|
inherited |
|
inherited |
Definition at line 102 of file FilterHighPassFIR.cc.
References Nsound::Buffer::begin(), Nsound::Buffer::end(), Nsound::FilterLowPassFIR::filter(), Nsound::FilterHighPassFIR::makeKernel(), and Nsound::FilterHighPassFIR::reset().
|
inlineinherited |
Definition at line 80 of file FilterHighPassFIR.h.
References Nsound::FilterLowPassFIR::frequency_1_Hz_.
Referenced by Nsound::FilterBandPassFIR::getFrequencyLow(), and Nsound::FilterBandPassFIR::plot().
|
inherited |
Definition at line 147 of file FilterHighPassFIR.cc.
References Nsound::Filter::getImpulseResponse().
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().
|
inherited |
Definition at line 154 of file FilterHighPassFIR.cc.
References Nsound::FilterLowPassFIR::b_, Nsound::FilterLowPassFIR::Kernel::b_, Nsound::FilterHighPassFIR::hp_cache_, Nsound::Filter::kernel_size_, Nsound::FilterLowPassFIR::makeKernel(), Nsound::Filter::sample_rate_, and Nsound::FilterHighPassFIR::spectraReversal_().
Referenced by Nsound::FilterHighPassFIR::filter(), makeKernel(), and Nsound::FilterHighPassFIR::reset().
|
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(), Nsound::FilterLowPassIIR::plot(), Nsound::FilterLowPassFIR::plot(), Nsound::FilterHighPassFIR::plot(), Nsound::FilterAllPass::plot(), Nsound::FilterBandPassVocoder::plot(), Nsound::FilterBandPassFIR::plot(), Nsound::FilterLeastSquaresFIR::plot(), Nsound::FilterFlanger::plot(), plot(), Nsound::FilterBandRejectIIR::plot(), Nsound::FilterBandPassIIR::plot(), and Nsound::FilterParametricEqualizer::plot().
|
protectedinherited |
Definition at line 258 of file FilterHighPassFIR.cc.
References Nsound::FilterLowPassFIR::b_, and Nsound::Filter::kernel_size_.
Referenced by Nsound::FilterHighPassFIR::makeKernel().
|
inherited |
Sets the cut off frequency (Hz).
Definition at line 366 of file FilterLowPassFIR.cc.
References Nsound::FilterLowPassFIR::frequency_1_Hz_, and Nsound::FilterLowPassFIR::reset().
|
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().
|
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 |
|
protected |
Definition at line 131 of file FilterBandRejectFIR.h.
Referenced by getFrequencyHigh(), plot(), and reset().
|
protected |
Definition at line 148 of file FilterBandRejectFIR.h.
Referenced by makeKernel(), and ~FilterBandRejectFIR().
|
protectedinherited |
Definition at line 99 of file FilterHighPassFIR.h.
Referenced by Nsound::FilterHighPassFIR::makeKernel(), and Nsound::FilterHighPassFIR::~FilterHighPassFIR().
|
protectedinherited |
Definition at line 104 of file FilterLowPassFIR.h.
Referenced by Nsound::FilterLowPassFIR::filter(), Nsound::FilterHighPassFIR::makeKernel(), Nsound::FilterLowPassFIR::makeKernel(), makeKernel(), and Nsound::FilterHighPassFIR::spectraReversal_().
|
protectedinherited |
Definition at line 105 of file FilterLowPassFIR.h.
Referenced by Nsound::FilterLowPassFIR::FilterLowPassFIR(), Nsound::FilterLowPassFIR::makeKernel(), and Nsound::FilterLowPassFIR::~FilterLowPassFIR().
|
protectedinherited |
Definition at line 108 of file FilterLowPassFIR.h.
Referenced by Nsound::FilterLowPassFIR::filter(), Nsound::FilterLowPassFIR::FilterLowPassFIR(), Nsound::FilterLowPassFIR::reset(), Nsound::FilterHighPassFIR::reset(), and Nsound::FilterLowPassFIR::~FilterLowPassFIR().
|
protectedinherited |
Definition at line 109 of file FilterLowPassFIR.h.
Referenced by Nsound::FilterLowPassFIR::filter(), Nsound::FilterLowPassFIR::FilterLowPassFIR(), Nsound::FilterLowPassFIR::reset(), and Nsound::FilterHighPassFIR::reset().
|
protectedinherited |
Definition at line 110 of file FilterLowPassFIR.h.
Referenced by Nsound::FilterLowPassFIR::filter(), and Nsound::FilterLowPassFIR::FilterLowPassFIR().
|
protectedinherited |
Definition at line 112 of file FilterLowPassFIR.h.
Referenced by FilterBandRejectFIR(), Nsound::FilterHighPassFIR::FilterHighPassFIR(), Nsound::FilterHighPassFIR::getFrequency(), Nsound::FilterLowPassFIR::getFrequency(), getFrequencyLow(), Nsound::FilterLowPassFIR::plot(), Nsound::FilterHighPassFIR::plot(), plot(), Nsound::FilterLowPassFIR::reset(), Nsound::FilterHighPassFIR::reset(), reset(), and Nsound::FilterLowPassFIR::setCutoff().
|
protectedinherited |
Definition at line 128 of file FilterLowPassFIR.h.
Referenced by Nsound::FilterLowPassFIR::makeKernel(), and Nsound::FilterLowPassFIR::~FilterLowPassFIR().
|
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(), Nsound::FilterLowPassIIR::plot(), Nsound::FilterLowPassFIR::plot(), Nsound::FilterAllPass::plot(), Nsound::FilterHighPassFIR::plot(), Nsound::FilterBandPassFIR::plot(), Nsound::FilterLeastSquaresFIR::plot(), Nsound::FilterFlanger::plot(), plot(), Nsound::FilterBandPassIIR::plot(), Nsound::FilterBandRejectIIR::plot(), Nsound::FilterParametricEqualizer::plot(), Nsound::FilterLowPassIIR::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(), Nsound::FilterLowPassIIR::FilterLowPassIIR(), Nsound::FilterLeastSquaresFIR::getKernel(), Nsound::Filter::getKernelSize(), Nsound::FilterHighPassFIR::makeKernel(), Nsound::FilterLowPassFIR::makeKernel(), makeKernel(), Nsound::FilterLeastSquaresFIR::makeKernel(), Nsound::FilterLeastSquaresFIR::operator=(), Nsound::FilterLowPassFIR::plot(), Nsound::FilterHighPassFIR::plot(), Nsound::FilterLeastSquaresFIR::plot(), 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(), filter(), Nsound::Filter::getImpulseResponse(), and Nsound::Filter::setRealtime().