Finite impulse response (FIR) filters which are useful for band-pass, low-pass and high-pass filtering.
FIR filters perform the following operation:
where is the filter order, are the filter coefficients, is the input at time and is the output at time . Functions are provided for designing the filter (i.e. finding the coefficients).
void FIRfilter | ( | EST_Wave & | in_sig, |
const EST_FVector & | numerator, | ||
int | delay_correction = 0 |
||
) |
General purpose FIR filter. This function will filter the waveform sig
with a previously designed filter, given as numerator
. The filter coefficients can be designed using one of the designed functions, e.g. design_FIR_filter.
void FIRfilter | ( | const EST_Wave & | in_sig, |
EST_Wave & | out_sig, | ||
const EST_FVector & | numerator, | ||
int | delay_correction = 0 |
||
) |
General purpose FIR filter. This function will filter the waveform sig
with a previously designed filter, given as numerator
. The filter coefficients can be designed using one of the designed functions, e.g. design_FIR_filter.
void FIR_double_filter | ( | EST_Wave & | in_sig, |
EST_Wave & | out_sig, | ||
const EST_FVector & | numerator | ||
) |
General purpose FIR double (zero-phase) filter. This function will double filter the waveform sig
with a previously designed filter, given as numerator
. The filter coefficients can be designed using one of the designed functions, e.g. design_FIR_filter. Double filtering is performed by filtering the signal normally, reversing the waveform, filtering again and reversing the waveform again. Normal filtering will impose a lag on the signal depending on the order of the filter. By filtering the signal forwards and backwards, the lags cancel each other out and the output signal is in phase with the input signal.
void FIRlowpass_filter | ( | EST_Wave & | sigin, |
int | freq, | ||
int | order = DEFAULT_FILTER_ORDER |
||
) |
Quick function for one-off low pass filtering. If repeated lowpass filtering is needed, first design the required filter using design_lowpass_filter, and then use FIRfilter to do the actual filtering.
sigin | input waveform, which will be overwritten |
freq | |
order | number of filter coefficients, eg. 99 |
void FIRlowpass_filter | ( | const EST_Wave & | in_sig, |
EST_Wave & | out_sig, | ||
int | freq, | ||
int | order = DEFAULT_FILTER_ORDER |
||
) |
Quick function for one-off low pass filtering. If repeated lowpass filtering is needed, first design the required filter using design_lowpass_filter, and then use FIRfilter to do the actual filtering.
in_sig | input waveform |
out_sig | output waveform |
freq | cutoff frequency in Hertz |
order | number of filter coefficients , e.g. 99 |
Quick function for one-off high pass filtering. If repeated lowpass filtering is needed, first design the required filter using design_lowpass_filter, and then use FIRfilter to do the actual filtering.
in_sig | input waveform, which will be overwritten |
freq | cutoff frequency in Hertz |
order | number of filter coefficients, eg. 99 |
void FIRhighpass_filter | ( | const EST_Wave & | sigin, |
EST_Wave & | out_sig, | ||
int | freq, | ||
int | order = DEFAULT_FILTER_ORDER |
||
) |
Quick function for one-off high pass filtering. If repeated highpass filtering is needed, first design the required filter using design_highpass_filter, and then use FIRfilter to do the actual filtering.
in_sig | input waveform |
out_sig | output waveform |
freq | cutoff frequency in Hertz |
order | number of filter coefficients, eg. 99 |
void FIRhighpass_double_filter | ( | EST_Wave & | sigin, |
int | freq, | ||
int | order = DEFAULT_FILTER_ORDER |
||
) |
Quick function for one-off double low pass filtering.
Normal low pass filtering (FIRlowpass_filter) introduces a time delay. This function filters the signal twice, first forward and then backwards, which ensures a zero phase lag. Hence the order parameter need only be half what it is for (FIRlowpass_filter to achieve the same effect.
in_sig | input waveform, which will be overwritten |
freq | cutoff frequency in Hertz |
order | number of filter coefficients, eg. 99 |
void FIRhighpass_double_filter | ( | const EST_Wave & | int_sig, |
EST_Wave & | out_sig, | ||
int | freq, | ||
int | order = DEFAULT_FILTER_ORDER |
||
) |
Quick function for one-off double low pass filtering.
Normal low pass filtering (FIRlowpass_filter) introduces a time delay. This function filters the signal twice, first forward and then backwards, which ensures a zero phase lag. Hence the order parameter need only be half what it is for (FIRlowpass_filter) to achieve the same effect.
in_sig | input waveform |
out_sig | output waveform |
freq | cutoff frequency in Hertz |
order | number of filter coefficients, eg. 99 |
void FIRlowpass_double_filter | ( | EST_Wave & | sigin, |
int | freq, | ||
int | order = DEFAULT_FILTER_ORDER |
||
) |
Quick function for one-off zero phase high pass filtering.
Normal high pass filtering (FIRhighpass_filter) introduces a time delay. This function filters the signal twice, first forward and then backwards, which ensures a zero phase lag. Hence the order parameter need only be half what it is for (FIRhighpass_filter) to achieve the same effect.
in_sig | input waveform, which will be overwritten |
freq | cutoff frequency in Hertz |
order | number of filter coefficients, eg. 99 |
void FIRlowpass_double_filter | ( | const EST_Wave & | in_sig, |
EST_Wave & | out_sig, | ||
int | freq, | ||
int | order = DEFAULT_FILTER_ORDER |
||
) |
Quick function for one-off zero phase high pass filtering.
Normal high pass filtering (FIRhighpass_filter) introduces a time delay. This function filters the signal twice, first forward and then backwards, which ensures a zero phase lag. Hence the order parameter need only be half what it is for (FIRhighpass_filter) to achieve the same effect.
in_sig | input waveform |
out_sig | output waveform |
freq | cutoff frequency in Hertz |
order | number of filter coefficients, eg. 99 |