#include <CL_FreqFilter.h>
|
| CL_FreqFilter (int size, fpreal overlap=0.1, fpreal discard=0.1, bool blend_chunks=true, bool filter_phase=false) |
|
| ~CL_FreqFilter () |
|
void | resize (int size) |
|
void | setFilter (int size, fpreal *filter, fpreal *phase=nullptr) |
|
bool | isReady () const |
| Ensures the filter has been set and the window size is valid. More...
|
|
void | setOverlap (fpreal overlap) |
|
void | setDiscard (fpreal discard) |
|
void | setBlendChunks (bool blend) |
|
void | setFilterPhase (bool filter_phase) |
|
template<class F , class FD > |
void | filter (fpreal *dest, int dest_capacity, fpreal freqstep, const F &evaluate_data, const FD &design_filter) |
|
template<class F > |
void | filter (fpreal *dest, int dest_capacity, fpreal freqstep, const F &evaluate_data) |
| Variant of the filter method which does not need to redesign the filter depending on the chunk. More...
|
|
template<class F > |
void | constrainedFilter (fpreal *dest, int dest_capacity, fpreal freqstep, const F &evaluate_data, int constrain_region, bool shift=true) |
|
|
template<class F > |
static void | designPassFilter (Type type, Design design, fpreal freq1, fpreal freq2, fpreal attenuation, fpreal pass_gain, int order, int size, fpreal freqstep, int index, int num, const F &override_parameters, fpreal *filter, fpreal *phase_filter=nullptr) |
|
static void | designPassFilter (Type type, Design design, fpreal freq1, fpreal freq2, fpreal attenuation, fpreal pass_gain, int order, int size, fpreal freqstep, fpreal *mag_filter, fpreal *phase_filter=nullptr) |
|
template<class F > |
static void | designBandEQFilter (Shape shape, fpreal basefreq, fpreal *bands, int num_bands, int size, fpreal freqstep, int index, int num, const F &override_parameters, fpreal *filter) |
|
template<class F > |
static void | designParaEQFilter (fpreal shape, fpreal freq, fpreal fgain, fpreal pgain, fpreal width, fpreal attenuation, int size, fpreal freqstep, int index, int num, const F &override_parameters, fpreal *filter) |
|
template<class F > |
static void | designAverageSideband (fpreal fgain, fpreal gain, fpreal effect, int length, int passfreq, int size, const F &evaluate_data, fpreal *filter) |
|
template<class F > |
static void | designContinuousSideband (fpreal fgain, fpreal gain, fpreal effect, int passfreq, int size, int index, const F &evaluate_data, fpreal *filter) |
|
Definition at line 26 of file CL_FreqFilter.h.
Enumerator |
---|
LOW_PASS |
|
HIGH_PASS |
|
BAND_PASS |
|
BAND_STOP |
|
Definition at line 31 of file CL_FreqFilter.h.
CL_FreqFilter::CL_FreqFilter |
( |
int |
size, |
|
|
fpreal |
overlap = 0.1 , |
|
|
fpreal |
discard = 0.1 , |
|
|
bool |
blend_chunks = true , |
|
|
bool |
filter_phase = false |
|
) |
| |
CL_FreqFilter::~CL_FreqFilter |
( |
| ) |
|
template<class F >
void CL_FreqFilter::constrainedFilter |
( |
fpreal * |
dest, |
|
|
int |
dest_capacity, |
|
|
fpreal |
freqstep, |
|
|
const F & |
evaluate_data, |
|
|
int |
constrain_region, |
|
|
bool |
shift = true |
|
) |
| |
Filter method which constrains the endpoints by "bending" the smoothed curve to match the start and end point of the original curve.
- Parameters
-
constrain_region | - Number of samples over which to bend the curve at the beginning and end of the curve. Setting this equal to the sample rate, attenuated by the high frequency cutoff tends to give good results for smoothing animation curves. Example: constrain_region = SYSmax((1.0 - high_cutoff) * sample_rate), 1) Setting this to a value <= 0 will skip the constraining step. |
shift | - If true, will apply a y-offset to the input data so the starting value is zero before smoothing. The smoothed curve will then be shifted back after smoothing. This helps avoid the step response which occurs when smoothing data with a non-zero starting y-value. This can be especially seen when applying the filter to a constant function |
Definition at line 454 of file CL_FreqFilter.h.
template<class F >
void CL_FreqFilter::designParaEQFilter |
( |
fpreal |
shape, |
|
|
fpreal |
freq, |
|
|
fpreal |
fgain, |
|
|
fpreal |
pgain, |
|
|
fpreal |
width, |
|
|
fpreal |
attenuation, |
|
|
int |
size, |
|
|
fpreal |
freqstep, |
|
|
int |
index, |
|
|
int |
num, |
|
|
const F & |
override_parameters, |
|
|
fpreal * |
filter |
|
) |
| |
|
static |
template<class F >
void CL_FreqFilter::designPassFilter |
( |
Type |
type, |
|
|
Design |
design, |
|
|
fpreal |
freq1, |
|
|
fpreal |
freq2, |
|
|
fpreal |
attenuation, |
|
|
fpreal |
pass_gain, |
|
|
int |
order, |
|
|
int |
size, |
|
|
fpreal |
freqstep, |
|
|
int |
index, |
|
|
int |
num, |
|
|
const F & |
override_parameters, |
|
|
fpreal * |
filter, |
|
|
fpreal * |
phase_filter = nullptr |
|
) |
| |
|
static |
Designs a pass filter, filling out the filter and phase_filter arrays Filter MUST be size floats long.
Definition at line 514 of file CL_FreqFilter.h.
static void CL_FreqFilter::designPassFilter |
( |
Type |
type, |
|
|
Design |
design, |
|
|
fpreal |
freq1, |
|
|
fpreal |
freq2, |
|
|
fpreal |
attenuation, |
|
|
fpreal |
pass_gain, |
|
|
int |
order, |
|
|
int |
size, |
|
|
fpreal |
freqstep, |
|
|
fpreal * |
mag_filter, |
|
|
fpreal * |
phase_filter = nullptr |
|
) |
| |
|
inlinestatic |
Variant of the designPassFilter method which does not have a parameter override method
Definition at line 90 of file CL_FreqFilter.h.
template<class F , class FD >
void CL_FreqFilter::filter |
( |
fpreal * |
dest, |
|
|
int |
dest_capacity, |
|
|
fpreal |
freqstep, |
|
|
const F & |
evaluate_data, |
|
|
const FD & |
design_filter |
|
) |
| |
Filter input data by applying the frequency domain filter
- Parameters
-
evaluate_data | lambda function which returns the data value at the given index |
design_filter | lambda function which redesigns the filter at the currently processed chunk. |
Definition at line 224 of file CL_FreqFilter.h.
template<class F >
void CL_FreqFilter::filter |
( |
fpreal * |
dest, |
|
|
int |
dest_capacity, |
|
|
fpreal |
freqstep, |
|
|
const F & |
evaluate_data |
|
) |
| |
|
inline |
Variant of the filter method which does not need to redesign the filter depending on the chunk.
Definition at line 148 of file CL_FreqFilter.h.
bool CL_FreqFilter::isReady |
( |
| ) |
const |
|
inline |
Ensures the filter has been set and the window size is valid.
Definition at line 66 of file CL_FreqFilter.h.
void CL_FreqFilter::resize |
( |
int |
size | ) |
|
void CL_FreqFilter::setBlendChunks |
( |
bool |
blend | ) |
|
|
inline |
void CL_FreqFilter::setFilterPhase |
( |
bool |
filter_phase | ) |
|
|
inline |
The documentation for this class was generated from the following file: