Functions | |
| EST_FVector | design_FIR_filter (const EST_FVector &freq_response, int filter_order) |
| EST_FVector | design_lowpass_FIR_filter (int sample_rate, int freq, int order) |
| EST_FVector | design_highpass_FIR_filter (int sample_rate, int freq, int order) |
FIR Filtering is a 2 stage process, first involving design and then the filtering itself. As the design is somewhat costly, it is usually desirable to design a filter outside the main loop.
For one off filtering operations, functions are provided which design and filter the waveform in a single go.
It is impossible to design an ideal filter, i.e. one which exactly obeys the desired frequency response. The "quality" of a filter is given by the order parameter, with high values indicating good approximations to desired responses. High orders are slower. The default is 199 which gives a pretty good filter, but a value as low as 19 is still usable if speech is important.
| EST_FVector design_FIR_filter | ( | const EST_FVector & | freq_response, |
| int | filter_order | ||
| ) |
Create an arbitrary filter or order order that attempts to give the frequency response given by freq_response. The vector freq_response should be any size 2**N and contain a plot of the desired frequency response with values ranging between 0.0 and 1.0. The actual filtering is done by FIRfilter.
| EST_FVector design_lowpass_FIR_filter | ( | int | sample_rate, |
| int | freq, | ||
| int | order | ||
| ) |
Design a FIR lowpass filter of order order and cut-off frequency freq. The filter coefficients are returned in the EST_FVector and should be used in conjunction with FIRfilter.
| EST_FVector design_highpass_FIR_filter | ( | int | sample_rate, |
| int | freq, | ||
| int | order | ||
| ) |
Design a FIR highpass filter of order order and cut-off frequency freq. The filter coefficients are returned in the EST_FVector and should be used in conjunction with FIRfilter