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 WIN_KAISER = 4
00043 };
00044
00045
00046
00061 static std::vector<float>
00062 low_pass (double gain,
00063 double sampling_freq,
00064 double cutoff_freq,
00065 double transition_width,
00066 win_type window = WIN_HAMMING,
00067 double beta = 6.76);
00068
00083 static std::vector<float>
00084 high_pass (double gain,
00085 double sampling_freq,
00086 double cutoff_freq,
00087 double transition_width,
00088 win_type window = WIN_HAMMING,
00089 double beta = 6.76);
00090
00106 static std::vector<float>
00107 band_pass (double gain,
00108 double sampling_freq,
00109 double low_cutoff_freq,
00110 double high_cutoff_freq,
00111 double transition_width,
00112 win_type window = WIN_HAMMING,
00113 double beta = 6.76);
00114
00115
00131 static std::vector<float>
00132 band_reject (double gain,
00133 double sampling_freq,
00134 double low_cutoff_freq,
00135 double high_cutoff_freq,
00136 double transition_width,
00137 win_type window = WIN_HAMMING,
00138 double beta = 6.76);
00139
00146 static std::vector<float>
00147 hilbert (unsigned int ntaps,
00148 win_type windowtype = WIN_RECTANGULAR,
00149 double beta = 6.76);
00150
00160 static std::vector<float>
00161 root_raised_cosine (double gain,
00162 double sampling_freq,
00163 double symbol_rate,
00164 double alpha,
00165 int ntaps);
00166
00174 static std::vector<float>
00175 gaussian (double gain,
00176 double spb,
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 private:
00184 static double bessi0(double x);
00185 static void sanity_check_1f (double sampling_freq, double f1,
00186 double transition_width);
00187 static void sanity_check_2f (double sampling_freq, double f1, double f2,
00188 double transition_width);
00189
00190 static int compute_ntaps (double sampling_freq,
00191 double transition_width,
00192 win_type window_type, double beta);
00193 };
00194
00195 #endif