4 * \brief Finite Impulse Response (FIR) filter design functions.
7 %rename(firdes) gr_firdes;
13 WIN_HAMMING = 0, // max attenuation 53 dB
14 WIN_HANN = 1, // max attenuation 44 dB
15 WIN_BLACKMAN = 2, // max attenuation 74 dB
17 WIN_KAISER = 4 // max attenuation variable with beta, google it
20 // ... class methods ...
23 * \brief use "window method" to design a low-pass FIR filter
25 * \p gain: overall gain of filter (typically 1.0)
26 * \p sampling_freq: sampling freq (Hz)
27 * \p cutoff_freq: center of transition band (Hz)
28 * \p transition_width: width of transition band (Hz).
29 * The normalized width of the transition
30 * band is what sets the number of taps
31 * required. Narrow --> more taps
32 * \p window_type: What kind of window to use. Determines
33 * maximum attenuation and passband ripple.
34 * \p beta: parameter for Kaiser window
36 static std::vector<float>
37 low_pass (double gain,
39 double cutoff_freq, // Hz center of transition band
40 double transition_width, // Hz width of transition band
41 win_type window = WIN_HAMMING,
42 double beta = 6.76); // used only with Kaiser
45 * \brief use "window method" to design a high-pass FIR filter
47 * \p gain: overall gain of filter (typically 1.0)
48 * \p sampling_freq: sampling freq (Hz)
49 * \p cutoff_freq: center of transition band (Hz)
50 * \p transition_width: width of transition band (Hz).
51 * The normalized width of the transition
52 * band is what sets the number of taps
53 * required. Narrow --> more taps
54 * \p window_type: What kind of window to use. Determines
55 * maximum attenuation and passband ripple.
56 * \p beta: parameter for Kaiser window
58 static std::vector<float>
59 high_pass (double gain,
61 double cutoff_freq, // Hz center of transition band
62 double transition_width, // Hz width of transition band
63 win_type window = WIN_HAMMING,
64 double beta = 6.76); // used only with Kaiser
67 * \brief use "window method" to design a band-pass FIR filter
69 * \p gain: overall gain of filter (typically 1.0)
70 * \p sampling_freq: sampling freq (Hz)
71 * \p low_cutoff_freq: center of transition band (Hz)
72 * \p high_cutoff_freq: center of transition band (Hz)
73 * \p transition_width: width of transition band (Hz).
74 * The normalized width of the transition
75 * band is what sets the number of taps
76 * required. Narrow --> more taps
77 * \p window_type: What kind of window to use. Determines
78 * maximum attenuation and passband ripple.
79 * \p beta: parameter for Kaiser window
81 static std::vector<float>
82 band_pass (double gain,
84 double low_cutoff_freq, // Hz center of transition band
85 double high_cutoff_freq, // Hz center of transition band
86 double transition_width, // Hz width of transition band
87 win_type window = WIN_HAMMING,
88 double beta = 6.76); // used only with Kaiser
92 * \brief use "window method" to design a band-reject FIR filter
94 * \p gain: overall gain of filter (typically 1.0)
95 * \p sampling_freq: sampling freq (Hz)
96 * \p low_cutoff_freq: center of transition band (Hz)
97 * \p high_cutoff_freq: center of transition band (Hz)
98 * \p transition_width: width of transition band (Hz).
99 * The normalized width of the transition
100 * band is what sets the number of taps
101 * required. Narrow --> more taps
102 * \p window_type: What kind of window to use. Determines
103 * maximum attenuation and passband ripple.
104 * \p beta: parameter for Kaiser window
107 static std::vector<gr_complex>
108 complex_band_pass (double gain,
109 double sampling_freq,
110 double low_cutoff_freq, // Hz center of transition band
111 double high_cutoff_freq, // Hz center of transition band
112 double transition_width, // Hz width of transition band
113 win_type window = WIN_HAMMING,
114 double beta = 6.76); // used only with Kaiser
118 * \brief use "window method" to design a band-reject FIR filter
120 * \p gain: overall gain of filter (typically 1.0)
121 * \p sampling_freq: sampling freq (Hz)
122 * \p low_cutoff_freq: center of transition band (Hz)
123 * \p high_cutoff_freq: center of transition band (Hz)
124 * \p transition_width: width of transition band (Hz).
125 * The normalized width of the transition
126 * band is what sets the number of taps
127 * required. Narrow --> more taps
128 * \p window_type: What kind of window to use. Determines
129 * maximum attenuation and passband ripple.
130 * \p beta: parameter for Kaiser window
133 static std::vector<float>
134 band_reject (double gain,
135 double sampling_freq,
136 double low_cutoff_freq, // Hz center of transition band
137 double high_cutoff_freq, // Hz center of transition band
138 double transition_width, // Hz width of transition band
139 win_type window = WIN_HAMMING,
140 double beta = 6.76); // used only with Kaiser
142 /*!\brief design a Hilbert Transform Filter
144 * \p ntaps: Number of taps, must be odd
145 * \p window_type: What kind of window to use
146 * \p beta: Only used for Kaiser
148 static std::vector<float>
149 hilbert (unsigned int ntaps,
150 win_type windowtype = WIN_RECTANGULAR,
154 * \brief design a Root Cosine FIR Filter (do we need a window?)
156 * \p gain: overall gain of filter (typically 1.0)
157 * \p sampling_freq: sampling freq (Hz)
158 * \p symbol rate: symbol rate, must be a factor of sample rate
159 * \p alpha: excess bandwidth factor
160 * \p ntaps: number of taps
162 static std::vector<float>
163 root_raised_cosine (double gain,
164 double sampling_freq,
165 double symbol_rate, // Symbol rate, NOT bitrate (unless BPSK)
166 double alpha, // Excess Bandwidth Factor
170 * \brief design a Gaussian filter
172 * \p gain: overall gain of filter (typically 1.0)
173 * \p symbols per bit: symbol rate, must be a factor of sample rate
174 * \p bt: BT bandwidth time product
175 * \p ntaps: number of taps
177 static std::vector<float>
178 gaussian (double gain,
180 double bt, // Bandwidth to bitrate ratio
184 * Return window given type, ntaps and optional beta.
186 static std::vector<float> gr_firdes::window (win_type type, int ntaps, double beta);