#include <stdlib.h>#include <string.h>#include <math.h>#include <stdint.h>#include "fir_win.h"#include "dt_window.h"

Go to the source code of this file.
Data Structures | |
| struct | ts_fwin |
| Private Data for Fir Window Filter. More... | |
Defines | |
| #define | FW_2PI (2.0 * M_PI) |
| #define | DOUBLE_Z_FIR 2 |
Typedefs | |
| typedef void(* | fwin_filter_function )(p_fwin fw) |
Functions | |
| static void | fwin_apply_window (p_fwin fw) |
| static void | fwin_reapply_window (p_fwin fw) |
| static void | band_pass (p_fwin fw) |
| static void | band_stop (p_fwin fw) |
| static void | low_pass (p_fwin fw) |
| static void | high_pass (p_fwin fw) |
| static void | average (p_fwin fw) |
| 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_apply (p_fwin fw, double *data, uint32_t size) |
| void | fwin_destroy (p_fwin *fw) |
Variables | |
| static const te_dt_window_type | FW_WINDOW_TABLE [FW_NUMBER_OF_WINDOW_TYPES] |
| static const fwin_filter_function | FW_FILTER_FUNCTIONS [FW_NUMBER_OF_FILTER_TYPES] |
| #define DOUBLE_Z_FIR 2 |
| #define FW_2PI (2.0 * M_PI) |
| typedef void( * fwin_filter_function)(p_fwin fw) |
| static void average | ( | p_fwin | fw | ) | [static] |
| static void band_pass | ( | p_fwin | fw | ) | [static] |
Definition at line 233 of file fir_win.c.
References ts_fwin::f_high, ts_fwin::f_low, FW_2PI, ts_fwin::h, ts_fwin::sample_freq, and ts_fwin::taps.
| static void band_stop | ( | p_fwin | fw | ) | [static] |
| 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().
| static void fwin_apply_window | ( | p_fwin | fw | ) | [static] |
Definition at line 282 of file fir_win.c.
References dt_window_apply(), dt_window_create(), FW_NONE, FW_NUMBER_OF_WINDOW_TYPES, FW_WINDOW_TABLE, ts_fwin::h, ts_fwin::h_window, ts_fwin::taps, and ts_fwin::window_type.
Referenced by fwin_create().

| 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().
| static void fwin_reapply_window | ( | p_fwin | fw | ) | [static] |
Definition at line 295 of file fir_win.c.
References dt_window_apply(), FW_NONE, ts_fwin::h, ts_fwin::h_window, and ts_fwin::window_type.
Referenced by fwin_change_freq().

| static void high_pass | ( | p_fwin | fw | ) | [static] |
| static void low_pass | ( | p_fwin | fw | ) | [static] |
const fwin_filter_function FW_FILTER_FUNCTIONS[FW_NUMBER_OF_FILTER_TYPES] [static] |
Initial value:
Definition at line 125 of file fir_win.c.
Referenced by fwin_change_freq(), and fwin_create().
const te_dt_window_type FW_WINDOW_TABLE[FW_NUMBER_OF_WINDOW_TYPES] [static] |
1.5.6