#include <stdint.h>
Go to the source code of this file.
Defines | |
#define | FWIN_USE_WINDOW_FUNCTION 1 |
Typedefs | |
typedef struct ts_fwin * | p_fwin |
Enumerations | |
enum | te_fir_win_filter_type { FW_BANDPASS = 0, FW_BANDSTOP, FW_LOWPASS, FW_HIGHPASS, FW_AVERAGE, FW_NUMBER_OF_FILTER_TYPES } |
enum | te_fir_win_window_type { FW_NONE = 0, FW_HAMMING, FW_HANNING, FW_BLACKMAN, FW_NUMBER_OF_WINDOW_TYPES } |
Functions | |
p_fwin | fwin_create (double sample_freq, double f_low, double f_high, te_fir_win_filter_type filter_type, te_fir_win_window_type window_type, uint32_t taps) |
void | fwin_change_freq (p_fwin fw, double f_low, double f_high) |
void | fwin_destroy (p_fwin *fw) |
void | fwin_apply (p_fwin fw, double *data, uint32_t size) |
#define FWIN_USE_WINDOW_FUNCTION 1 |
FIR filter types.
FW_BANDPASS | Bandpass filter |
FW_BANDSTOP |
Bandstop filter
|
FW_LOWPASS |
Lowpass filter
|
FW_HIGHPASS |
Highpass filter
|
FW_AVERAGE | Average filter Sample frequency, low and high cutoff frequency, and window type do not apply. |
FW_NUMBER_OF_FILTER_TYPES |
void fwin_apply | ( | p_fwin | fw, | |
double * | data, | |||
uint32_t | size | |||
) |
Apply the FIR filter to sampled data.
fw | Pointer to the FIR filter object. | |
data | Pointer to the data to be filtered. | |
size | Number of data points in data. |
Definition at line 190 of file fir_win.c.
References ts_fwin::h, ts_fwin::taps, ts_fwin::z, and ts_fwin::z_state.
Referenced by morse_code().
void fwin_change_freq | ( | p_fwin | fw, | |
double | f_low, | |||
double | f_high | |||
) |
Changes the frequency response of an existing FIR filter.
fw | Pointer to existing FIR filter object. | |
f_low | New low frequency cut-off in Hertz. | |
f_high | New high frequency cut-off in Hertz. |
Definition at line 174 of file fir_win.c.
References ts_fwin::f_high, ts_fwin::f_low, ts_fwin::filter_type, FW_FILTER_FUNCTIONS, and fwin_reapply_window().
Referenced by morse_recompute_filter().
p_fwin fwin_create | ( | double | sample_freq, | |
double | f_low, | |||
double | f_high, | |||
te_fir_win_filter_type | filter_type, | |||
te_fir_win_window_type | window_type, | |||
uint32_t | taps | |||
) |
Creates a FIR filter via the window method.
sample_freq | Sample frequency in Hertz. | |
f_low | Low frequency cut-off in Hertz. | |
f_high | High frequency cut-off in Hertz. | |
filter_type | Filter type, band-pass, high-pass, low-pass, etc... | |
window_type | Window applied to the FIR filter coefficients. | |
taps | Number of FIR filter taps (N). |
Definition at line 133 of file fir_win.c.
References DOUBLE_Z_FIR, ts_fwin::f_high, ts_fwin::f_low, ts_fwin::filter_type, FW_FILTER_FUNCTIONS, FW_NUMBER_OF_FILTER_TYPES, fwin_apply_window(), ts_fwin::h, ts_fwin::h_window, ts_fwin::sample_freq, ts_fwin::taps, ts_fwin::window_type, ts_fwin::z, and ts_fwin::z_state.
Referenced by morse_start_threads().
void fwin_destroy | ( | p_fwin * | fw | ) |
Destroys, and frees all memory from a window FIR filter object.
fw | Pointer to the FIR filter object to be freed. |
Definition at line 220 of file fir_win.c.
Referenced by free_all().