Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

gr_firdes.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2002 Free Software Foundation, Inc.
00004  * 
00005  * This file is part of GNU Radio
00006  * 
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2, or (at your option)
00010  * any later version.
00011  * 
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  * Boston, MA 02111-1307, USA.
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,    // max attenuation 53 dB
00039     WIN_HANN = 1,       // max attenuation 44 dB
00040     WIN_BLACKMAN = 2,   // max attenuation 74 dB
00041     WIN_RECTANGULAR = 3,
00042     WIN_KAISER = 4      // max attenuation a function of beta, google it
00043   };
00044 
00045   // ... class methods ...
00046 
00061   static std::vector<float>
00062   low_pass (double gain,
00063             double sampling_freq,
00064             double cutoff_freq,         // Hz center of transition band
00065             double transition_width,    // Hz width of transition band
00066             win_type window = WIN_HAMMING,
00067             double beta = 6.76);                // used only with Kaiser
00068 
00083   static std::vector<float>
00084   high_pass (double gain,
00085              double sampling_freq,
00086              double cutoff_freq,                // Hz center of transition band
00087              double transition_width,           // Hz width of transition band
00088              win_type window = WIN_HAMMING,
00089              double beta = 6.76);               // used only with Kaiser
00090 
00106   static std::vector<float>
00107   band_pass (double gain,
00108              double sampling_freq,
00109              double low_cutoff_freq,            // Hz center of transition band
00110              double high_cutoff_freq,           // Hz center of transition band
00111              double transition_width,           // Hz width of transition band
00112              win_type window = WIN_HAMMING,
00113              double beta = 6.76);               // used only with Kaiser
00114 
00115 
00131   static std::vector<float>
00132   band_reject (double gain,
00133                double sampling_freq,
00134                double low_cutoff_freq,          // Hz center of transition band
00135                double high_cutoff_freq,         // Hz center of transition band
00136                double transition_width,         // Hz width of transition band
00137                win_type window = WIN_HAMMING,
00138                double beta = 6.76);             // used only with Kaiser
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,       // Symbol rate, NOT bitrate (unless BPSK)
00164                       double alpha,             // Excess Bandwidth Factor
00165                       int ntaps);
00166 
00174   static std::vector<float>
00175   gaussian (double gain,
00176             double spb,       
00177             double bt,              // Bandwidth to bitrate ratio
00178             int ntaps);
00179 
00180   // window functions ...
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

Generated on Fri Dec 9 14:01:45 2005 for GNU Radio 2.x by  doxygen 1.4.1