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
43 ) throw(std::out_of_range);
46 * \brief use "window method" to design a high-pass FIR filter
48 * \p gain: overall gain of filter (typically 1.0)
49 * \p sampling_freq: sampling freq (Hz)
50 * \p cutoff_freq: center of transition band (Hz)
51 * \p transition_width: width of transition band (Hz).
52 * The normalized width of the transition
53 * band is what sets the number of taps
54 * required. Narrow --> more taps
55 * \p window_type: What kind of window to use. Determines
56 * maximum attenuation and passband ripple.
57 * \p beta: parameter for Kaiser window
59 static std::vector<float>
60 high_pass (double gain,
62 double cutoff_freq, // Hz center of transition band
63 double transition_width, // Hz width of transition band
64 win_type window = WIN_HAMMING,
65 double beta = 6.76 // used only with Kaiser
66 ) throw(std::out_of_range);
69 * \brief use "window method" to design a band-pass FIR filter
71 * \p gain: overall gain of filter (typically 1.0)
72 * \p sampling_freq: sampling freq (Hz)
73 * \p low_cutoff_freq: center of transition band (Hz)
74 * \p high_cutoff_freq: center of transition band (Hz)
75 * \p transition_width: width of transition band (Hz).
76 * The normalized width of the transition
77 * band is what sets the number of taps
78 * required. Narrow --> more taps
79 * \p window_type: What kind of window to use. Determines
80 * maximum attenuation and passband ripple.
81 * \p beta: parameter for Kaiser window
83 static std::vector<float>
84 band_pass (double gain,
86 double low_cutoff_freq, // Hz center of transition band
87 double high_cutoff_freq, // Hz center of transition band
88 double transition_width, // Hz width of transition band
89 win_type window = WIN_HAMMING,
90 double beta = 6.76 // used only with Kaiser
91 ) throw(std::out_of_range);
95 * \brief use "window method" to design a band-reject FIR filter
97 * \p gain: overall gain of filter (typically 1.0)
98 * \p sampling_freq: sampling freq (Hz)
99 * \p low_cutoff_freq: center of transition band (Hz)
100 * \p high_cutoff_freq: center of transition band (Hz)
101 * \p transition_width: width of transition band (Hz).
102 * The normalized width of the transition
103 * band is what sets the number of taps
104 * required. Narrow --> more taps
105 * \p window_type: What kind of window to use. Determines
106 * maximum attenuation and passband ripple.
107 * \p beta: parameter for Kaiser window
110 static std::vector<gr_complex>
111 complex_band_pass (double gain,
112 double sampling_freq,
113 double low_cutoff_freq, // Hz center of transition band
114 double high_cutoff_freq, // Hz center of transition band
115 double transition_width, // Hz width of transition band
116 win_type window = WIN_HAMMING, // used only with Kaiser
118 ) throw(std::out_of_range);
122 * \brief use "window method" to design a band-reject FIR filter
124 * \p gain: overall gain of filter (typically 1.0)
125 * \p sampling_freq: sampling freq (Hz)
126 * \p low_cutoff_freq: center of transition band (Hz)
127 * \p high_cutoff_freq: center of transition band (Hz)
128 * \p transition_width: width of transition band (Hz).
129 * The normalized width of the transition
130 * band is what sets the number of taps
131 * required. Narrow --> more taps
132 * \p window_type: What kind of window to use. Determines
133 * maximum attenuation and passband ripple.
134 * \p beta: parameter for Kaiser window
137 static std::vector<float>
138 band_reject (double gain,
139 double sampling_freq,
140 double low_cutoff_freq, // Hz center of transition band
141 double high_cutoff_freq, // Hz center of transition band
142 double transition_width, // Hz width of transition band
143 win_type window = WIN_HAMMING, // used only with Kaiser
145 ) throw(std::out_of_range);
147 /*!\brief design a Hilbert Transform Filter
149 * \p ntaps: Number of taps, must be odd
150 * \p window_type: What kind of window to use
151 * \p beta: Only used for Kaiser
153 static std::vector<float>
154 hilbert (unsigned int ntaps = 19,
155 win_type windowtype = WIN_RECTANGULAR,
157 ) throw(std::out_of_range);
160 * \brief design a Root Cosine FIR Filter (do we need a window?)
162 * \p gain: overall gain of filter (typically 1.0)
163 * \p sampling_freq: sampling freq (Hz)
164 * \p symbol rate: symbol rate, must be a factor of sample rate
165 * \p alpha: excess bandwidth factor
166 * \p ntaps: number of taps
168 static std::vector<float>
169 root_raised_cosine (double gain,
170 double sampling_freq,
171 double symbol_rate, // Symbol rate, NOT bitrate (unless BPSK)
172 double alpha, // Excess Bandwidth Factor
173 int ntaps) throw(std::out_of_range);
176 * \brief design a Gaussian filter
178 * \p gain: overall gain of filter (typically 1.0)
179 * \p symbols per bit: symbol rate, must be a factor of sample rate
180 * \p bt: BT bandwidth time product
181 * \p ntaps: number of taps
183 static std::vector<float>
184 gaussian (double gain,
186 double bt, // Bandwidth to bitrate ratio
187 int ntaps) throw(std::out_of_range);
190 * Return window given type, ntaps and optional beta.
192 static std::vector<float> gr_firdes::window (win_type type, int ntaps, double beta)
193 throw(std::runtime_error);