00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _GR_FIRDES_H_
00024 #define _GR_FIRDES_H_
00025
00026 #include <vector>
00027 #include <cmath>
00028
00033 class gr_firdes {
00034 public:
00035
00036 enum win_type {
00037 WIN_HAMMING = 0,
00038 WIN_HANN = 1,
00039 WIN_BLACKMAN = 2,
00040 WIN_RECTANGULAR = 3
00041 };
00042
00043
00044
00059 static std::vector<float>
00060 low_pass (double gain,
00061 double sampling_freq,
00062 double cutoff_freq,
00063 double transition_width,
00064 win_type window = WIN_HAMMING,
00065 double beta = 6.76);
00066
00081 static std::vector<float>
00082 high_pass (double gain,
00083 double sampling_freq,
00084 double cutoff_freq,
00085 double transition_width,
00086 win_type window = WIN_HAMMING,
00087 double beta = 6.76);
00088
00104 static std::vector<float>
00105 band_pass (double gain,
00106 double sampling_freq,
00107 double low_cutoff_freq,
00108 double high_cutoff_freq,
00109 double transition_width,
00110 win_type window = WIN_HAMMING,
00111 double beta = 6.76);
00112
00113
00129 static std::vector<float>
00130 band_reject (double gain,
00131 double sampling_freq,
00132 double low_cutoff_freq,
00133 double high_cutoff_freq,
00134 double transition_width,
00135 win_type window = WIN_HAMMING,
00136 double beta = 6.76);
00137
00144 static std::vector<float>
00145 hilbert (unsigned int ntaps,
00146 win_type windowtype = WIN_RECTANGULAR,
00147 double beta = 6.76);
00148
00158 static std::vector<float>
00159 root_raised_cosine (double gain,
00160 double sampling_freq,
00161 double symbol_rate,
00162 double alpha,
00163 int ntaps);
00164
00173 static std::vector<float>
00174 gaussian (double gain,
00175 double sampling_freq,
00176 double symbol_rate,
00177 double bt,
00178 int ntaps);
00179
00180
00181 static std::vector<float> gr_firdes::window (win_type type, int ntaps, double beta);
00182
00183
00184 static std::vector<float> reverse (const std::vector<float> &taps);
00185
00186 private:
00187 static void sanity_check_1f (double sampling_freq, double f1,
00188 double transition_width);
00189 static void sanity_check_2f (double sampling_freq, double f1, double f2,
00190 double transition_width);
00191
00192 static int compute_ntaps (double sampling_freq,
00193 double transition_width,
00194 win_type window_type, double beta);
00195 };
00196
00197 #endif