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 #include <gr_complex.h>
00029
00034 class gr_firdes {
00035 public:
00036
00037 enum win_type {
00038 WIN_HAMMING = 0,
00039 WIN_HANN = 1,
00040 WIN_BLACKMAN = 2,
00041 WIN_RECTANGULAR = 3
00042 };
00043
00044
00045
00060 static std::vector<float>
00061 low_pass (double gain,
00062 double sampling_freq,
00063 double cutoff_freq,
00064 double transition_width,
00065 win_type window = WIN_HAMMING,
00066 double beta = 6.76);
00067
00082 static std::vector<float>
00083 high_pass (double gain,
00084 double sampling_freq,
00085 double cutoff_freq,
00086 double transition_width,
00087 win_type window = WIN_HAMMING,
00088 double beta = 6.76);
00089
00105 static std::vector<float>
00106 band_pass (double gain,
00107 double sampling_freq,
00108 double low_cutoff_freq,
00109 double high_cutoff_freq,
00110 double transition_width,
00111 win_type window = WIN_HAMMING,
00112 double beta = 6.76);
00113
00114
00130 static std::vector<float>
00131 band_reject (double gain,
00132 double sampling_freq,
00133 double low_cutoff_freq,
00134 double high_cutoff_freq,
00135 double transition_width,
00136 win_type window = WIN_HAMMING,
00137 double beta = 6.76);
00138
00145 static std::vector<float>
00146 hilbert (unsigned int ntaps,
00147 win_type windowtype = WIN_RECTANGULAR,
00148 double beta = 6.76);
00149
00159 static std::vector<float>
00160 root_raised_cosine (double gain,
00161 double sampling_freq,
00162 double symbol_rate,
00163 double alpha,
00164 int ntaps);
00165
00174 static std::vector<float>
00175 gaussian (double gain,
00176 double sampling_freq,
00177 double symbol_rate,
00178 double bt,
00179 int ntaps);
00180
00181
00182 static std::vector<float> gr_firdes::window (win_type type, int ntaps, double beta);
00183
00184
00185 static std::vector<float> reverse (const std::vector<float> &taps);
00186 static std::vector<gr_complex> reverse (const std::vector<gr_complex> &taps);
00187
00188 private:
00189 static void sanity_check_1f (double sampling_freq, double f1,
00190 double transition_width);
00191 static void sanity_check_2f (double sampling_freq, double f1, double f2,
00192 double transition_width);
00193
00194 static int compute_ntaps (double sampling_freq,
00195 double transition_width,
00196 win_type window_type, double beta);
00197 };
00198
00199 #endif