diff options
-rw-r--r-- | cmake/Modules/UseSWIG.cmake | 4 | ||||
-rw-r--r-- | gr-fft/lib/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gr-fft/lib/fft.cc | 53 | ||||
-rw-r--r-- | gr-filter/include/gnuradio/filter/firdes.h | 443 | ||||
-rw-r--r-- | gr-filter/lib/firdes.cc | 10 | ||||
-rw-r--r-- | grc/base/Element.py | 9 |
6 files changed, 251 insertions, 269 deletions
diff --git a/cmake/Modules/UseSWIG.cmake b/cmake/Modules/UseSWIG.cmake index c0f172870b..d1014943de 100644 --- a/cmake/Modules/UseSWIG.cmake +++ b/cmake/Modules/UseSWIG.cmake @@ -224,9 +224,9 @@ print(re.sub('\\W', '_', '${name} ${reldir} ' + unique))" foreach(swig_gen_file ${${outfiles}}) add_custom_command( OUTPUT ${swig_gen_file} - COMMAND "" + COMMAND DEPENDS ${_target} - COMMENT "" + COMMENT ) endforeach() diff --git a/gr-fft/lib/CMakeLists.txt b/gr-fft/lib/CMakeLists.txt index 7dd576f6f6..77476e58b4 100644 --- a/gr-fft/lib/CMakeLists.txt +++ b/gr-fft/lib/CMakeLists.txt @@ -57,6 +57,7 @@ endif(ENABLE_GR_CTRLPORT) list(APPEND fft_libs gnuradio-runtime + ${VOLK_LIBRARIES} ${Boost_LIBRARIES} ${FFTW3F_LIBRARIES} ) diff --git a/gr-fft/lib/fft.cc b/gr-fft/lib/fft.cc index 729600cb1c..90417129ed 100644 --- a/gr-fft/lib/fft.cc +++ b/gr-fft/lib/fft.cc @@ -22,6 +22,8 @@ #include <gnuradio/fft/fft.h> #include <gnuradio/sys_paths.h> +#include <gnuradio/gr_complex.h> +#include <volk/volk.h> #include <fftw3.h> #ifdef _MSC_VER //http://www.fftw.org/install/windows.html#DLLwisdom @@ -36,7 +38,6 @@ static int my_fftw_read_char(void *f) { return fgetc((FILE *) f); } #define fftwl_import_wisdom_from_file(f) fftwl_import_wisdom(my_fftw_read_char, (void*) (f)) #endif //_MSC_VER -#include <gnuradio/gr_complex.h> #include <stdlib.h> #include <string.h> #include <stdio.h> @@ -53,25 +54,25 @@ namespace gr { gr_complex * malloc_complex(int size) { - return (gr_complex*)fftwf_malloc(sizeof(gr_complex)*size); + return (gr_complex*) volk_malloc (sizeof (gr_complex)*size, volk_get_alignment ()); } float * malloc_float(int size) { - return (float*)fftwf_malloc(sizeof(float)*size); + return (float*) volk_malloc (sizeof (float)*size, volk_get_alignment ()); } double * malloc_double(int size) { - return (double*)fftwf_malloc(sizeof(double)*size); + return (double*) volk_malloc (sizeof (double)*size, volk_get_alignment ()); } void free(void *b) { - fftwf_free(b); + volk_free(b); } boost::mutex & @@ -149,14 +150,14 @@ namespace gr { } d_fft_size = fft_size; - d_inbuf = (gr_complex *) fftwf_malloc (sizeof (gr_complex) * inbuf_length ()); + d_inbuf = (gr_complex *) volk_malloc (sizeof (gr_complex) * inbuf_length (), volk_get_alignment ()); if (d_inbuf == 0) { - throw std::runtime_error ("fftwf_malloc"); + throw std::runtime_error ("volk_malloc"); } - d_outbuf = (gr_complex *) fftwf_malloc (sizeof (gr_complex) * outbuf_length ()); + d_outbuf = (gr_complex *) volk_malloc (sizeof (gr_complex) * outbuf_length (), volk_get_alignment ()); if (d_outbuf == 0) { - fftwf_free (d_inbuf); - throw std::runtime_error ("fftwf_malloc"); + volk_free (d_inbuf); + throw std::runtime_error ("volk_malloc"); } d_nthreads = nthreads; @@ -182,8 +183,8 @@ namespace gr { planner::scoped_lock lock(planner::mutex()); fftwf_destroy_plan ((fftwf_plan) d_plan); - fftwf_free (d_inbuf); - fftwf_free (d_outbuf); + volk_free (d_inbuf); + volk_free (d_outbuf); } void @@ -219,15 +220,15 @@ namespace gr { } d_fft_size = fft_size; - d_inbuf = (float *) fftwf_malloc (sizeof (float) * inbuf_length ()); + d_inbuf = (float *) volk_malloc (sizeof (float) * inbuf_length (), volk_get_alignment ()); if (d_inbuf == 0) { - throw std::runtime_error ("fftwf_malloc"); + throw std::runtime_error ("volk_malloc"); } - d_outbuf = (gr_complex *) fftwf_malloc (sizeof (gr_complex) * outbuf_length ()); + d_outbuf = (gr_complex *) volk_malloc (sizeof (gr_complex) * outbuf_length (), volk_get_alignment ()); if (d_outbuf == 0) { - fftwf_free (d_inbuf); - throw std::runtime_error ("fftwf_malloc"); + volk_free (d_inbuf); + throw std::runtime_error ("volk_malloc"); } d_nthreads = nthreads; @@ -252,8 +253,8 @@ namespace gr { planner::scoped_lock lock(planner::mutex()); fftwf_destroy_plan ((fftwf_plan) d_plan); - fftwf_free (d_inbuf); - fftwf_free (d_outbuf); + volk_free (d_inbuf); + volk_free (d_outbuf); } void @@ -289,15 +290,15 @@ namespace gr { } d_fft_size = fft_size; - d_inbuf = (gr_complex *) fftwf_malloc (sizeof (gr_complex) * inbuf_length ()); + d_inbuf = (gr_complex *) volk_malloc (sizeof (gr_complex) * inbuf_length (), volk_get_alignment ()); if (d_inbuf == 0) { - throw std::runtime_error ("fftwf_malloc"); + throw std::runtime_error ("volk_malloc"); } - d_outbuf = (float *) fftwf_malloc (sizeof (float) * outbuf_length ()); + d_outbuf = (float *) volk_malloc (sizeof (float) * outbuf_length (), volk_get_alignment ()); if (d_outbuf == 0) { - fftwf_free (d_inbuf); - throw std::runtime_error ("fftwf_malloc"); + volk_free (d_inbuf); + throw std::runtime_error ("volk_malloc"); } d_nthreads = nthreads; @@ -325,8 +326,8 @@ namespace gr { planner::scoped_lock lock(planner::mutex()); fftwf_destroy_plan ((fftwf_plan) d_plan); - fftwf_free (d_inbuf); - fftwf_free (d_outbuf); + volk_free (d_inbuf); + volk_free (d_outbuf); } void diff --git a/gr-filter/include/gnuradio/filter/firdes.h b/gr-filter/include/gnuradio/filter/firdes.h index 78540bd6aa..c379ad0299 100644 --- a/gr-filter/include/gnuradio/filter/firdes.h +++ b/gr-filter/include/gnuradio/filter/firdes.h @@ -60,303 +60,282 @@ namespace gr { // ... class methods ... /*! - * \brief use "window method" to design a low-pass FIR filter + * \brief Use "window method" to design a low-pass FIR filter. The + * normalized width of the transition band is what sets the number of + * taps required. Narrow --> more taps. Window type determines maximum + * attenuation and passband ripple. * - * \p gain: overall gain of filter (typically 1.0) - * \p sampling_freq: sampling freq (Hz) - * \p cutoff_freq: center of transition band (Hz) - * \p transition_width: width of transition band (Hz). - * The normalized width of the transition - * band is what sets the number of taps - * required. Narrow --> more taps - * \p window_type: What kind of window to use. Determines - * maximum attenuation and passband ripple. - * \p beta: parameter for Kaiser window + * \param gain overall gain of filter (typically 1.0) + * \param sampling_freq sampling freq (Hz) + * \param cutoff_freq center of transition band (Hz) + * \param transition_width width of transition band (Hz) + * \param window one of firdes::win_type + * \param beta parameter for Kaiser window */ static std::vector<float> - low_pass(double gain, - double sampling_freq, - double cutoff_freq, // Hz center of transition band - double transition_width, // Hz width of transition band - win_type window = WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + low_pass(double gain, + double sampling_freq, + double cutoff_freq, // Hz center of transition band + double transition_width, // Hz width of transition band + win_type window = WIN_HAMMING, + double beta = 6.76); // used only with Kaiser /*! - * \brief use "window method" to design a low-pass FIR filter + * \brief Use "window method" to design a low-pass FIR filter. The + * normalized width of the transition band and the required stop band + * attenuation is what sets the number of taps required. Narrow --> more + * taps More attenuation --> more taps. The window type determines + * maximum attentuation and passband ripple. * - * \p gain: overall gain of filter (typically 1.0) - * \p sampling_freq: sampling freq (Hz) - * \p cutoff_freq: center of transition band (Hz) - * \p transition_width: width of transition band (Hz). - * \p attenuation_dB required stopband attenuation - * The normalized width of the transition - * band and the required stop band - * attenuation is what sets the number of taps - * required. Narrow --> more taps - * More attenuatin --> more taps - * \p window_type: What kind of window to use. Determines - * maximum attenuation and passband ripple. - * \p beta: parameter for Kaiser window + * \param gain overall gain of filter (typically 1.0) + * \param sampling_freq sampling freq (Hz) + * \param cutoff_freq beginning of transition band (Hz) + * \param transition_width width of transition band (Hz) + * \param attenuation_dB required stopband attenuation + * \param window one of firdes::win_type + * \param beta parameter for Kaiser window */ - static std::vector<float> - low_pass_2(double gain, - double sampling_freq, - double cutoff_freq, // Hz beginning transition band - double transition_width, // Hz width of transition band - double attenuation_dB, // out of band attenuation dB - win_type window = WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + low_pass_2(double gain, + double sampling_freq, + double cutoff_freq, // Hz beginning transition band + double transition_width, // Hz width of transition band + double attenuation_dB, // out of band attenuation dB + win_type window = WIN_HAMMING, + double beta = 6.76); // used only with Kaiser /*! - * \brief use "window method" to design a high-pass FIR filter + * \brief Use "window method" to design a high-pass FIR filter. The + * normalized width of the transition band is what sets the number of + * taps required. Narrow --> more taps. The window determines maximum + * attenuation and passband ripple. * - * \p gain: overall gain of filter (typically 1.0) - * \p sampling_freq: sampling freq (Hz) - * \p cutoff_freq: center of transition band (Hz) - * \p transition_width: width of transition band (Hz). - * The normalized width of the transition - * band is what sets the number of taps - * required. Narrow --> more taps - * \p window_type: What kind of window to use. Determines - * maximum attenuation and passband ripple. - * \p beta: parameter for Kaiser window + * \param gain overall gain of filter (typically 1.0) + * \param sampling_freq sampling freq (Hz) + * \param cutoff_freq center of transition band (Hz) + * \param transition_width width of transition band (Hz) + * \param window one of firdes::win_type + * \param beta parameter for Kaiser window */ - static std::vector<float> - high_pass(double gain, - double sampling_freq, - double cutoff_freq, // Hz center of transition band - double transition_width, // Hz width of transition band - win_type window = WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + high_pass(double gain, + double sampling_freq, + double cutoff_freq, // Hz center of transition band + double transition_width, // Hz width of transition band + win_type window = WIN_HAMMING, + double beta = 6.76); // used only with Kaiser /*! - * \brief use "window method" to design a high-pass FIR filter + * \brief Use "window method" to design a high-pass FIR filter. The + * normalized width of the transition band and the required stop band + * attenuation is what sets the number of taps required. Narrow --> more + * taps More attenuation --> more taps. The window determines maximum + * attenuation and passband ripple. * - * \p gain: overall gain of filter (typically 1.0) - * \p sampling_freq: sampling freq (Hz) - * \p cutoff_freq: center of transition band (Hz) - * \p transition_width: width of transition band (Hz). - * \p attenuation_dB out of band attenuation - * The normalized width of the transition - * band and the required stop band - * attenuation is what sets the number of taps - * required. Narrow --> more taps - * More attenuation --> more taps - * \p window_type: What kind of window to use. Determines - * maximum attenuation and passband ripple. - * \p beta: parameter for Kaiser window + * \param gain overall gain of filter (typically 1.0) + * \param sampling_freq sampling freq (Hz) + * \param cutoff_freq center of transition band (Hz) + * \param transition_width width of transition band (Hz). + * \param attenuation_dB out of band attenuation + * \param window one of firdes::win_type + * \param beta parameter for Kaiser window */ - static std::vector<float> - high_pass_2(double gain, - double sampling_freq, - double cutoff_freq, // Hz center of transition band - double transition_width, // Hz width of transition band - double attenuation_dB, // out of band attenuation dB - win_type window = WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + high_pass_2(double gain, + double sampling_freq, + double cutoff_freq, // Hz center of transition band + double transition_width, // Hz width of transition band + double attenuation_dB, // out of band attenuation dB + win_type window = WIN_HAMMING, + double beta = 6.76); // used only with Kaiser /*! - * \brief use "window method" to design a band-pass FIR filter + * \brief Use "window method" to design a band-pass FIR filter. The + * normalized width of the transition band is what sets the number of + * taps required. Narrow --> more taps. The window determines maximum + * attenuation and passband ripple. * - * \p gain: overall gain of filter (typically 1.0) - * \p sampling_freq: sampling freq (Hz) - * \p low_cutoff_freq: center of transition band (Hz) - * \p high_cutoff_freq: center of transition band (Hz) - * \p transition_width: width of transition band (Hz). - * The normalized width of the transition - * band is what sets the number of taps - * required. Narrow --> more taps - * \p window_type: What kind of window to use. Determines - * maximum attenuation and passband ripple. - * \p beta: parameter for Kaiser window + * \param gain overall gain of filter (typically 1.0) + * \param sampling_freq sampling freq (Hz) + * \param low_cutoff_freq center of transition band (Hz) + * \param high_cutoff_freq center of transition band (Hz) + * \param transition_width width of transition band (Hz). + * \param window one of firdes::win_type + * \param beta parameter for Kaiser window */ static std::vector<float> - band_pass(double gain, - double sampling_freq, - double low_cutoff_freq, // Hz center of transition band - double high_cutoff_freq, // Hz center of transition band - double transition_width, // Hz width of transition band - win_type window = WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + band_pass(double gain, + double sampling_freq, + double low_cutoff_freq, // Hz center of transition band + double high_cutoff_freq, // Hz center of transition band + double transition_width, // Hz width of transition band + win_type window = WIN_HAMMING, + double beta = 6.76); // used only with Kaiser /*! - * \brief use "window method" to design a band-pass FIR filter + * \brief Use "window method" to design a band-pass FIR filter. The + * normalized width of the transition band and the required stop band + * attenuation is what sets the number of taps required. Narrow --> more + * taps. More attenuation --> more taps. Window type determines maximum + * attenuation and passband ripple. * - * \p gain: overall gain of filter (typically 1.0) - * \p sampling_freq: sampling freq (Hz) - * \p low_cutoff_freq: center of transition band (Hz) - * \p high_cutoff_freq: center of transition band (Hz) - * \p transition_width: width of transition band (Hz). - * \p attenuation_dB out of band attenuation - * The normalized width of the transition - * band and the required stop band - * attenuation is what sets the number of taps - * required. Narrow --> more taps - * More attenuation --> more taps - * \p window_type: What kind of window to use. Determines - * maximum attenuation and passband ripple. - * \p beta: parameter for Kaiser window + * \param gain overall gain of filter (typically 1.0) + * \param sampling_freq sampling freq (Hz) + * \param low_cutoff_freq center of transition band (Hz) + * \param high_cutoff_freq center of transition band (Hz) + * \param transition_width width of transition band (Hz). + * \param attenuation_dB out of band attenuation + * \param window one of firdes::win_type + * \param beta parameter for Kaiser window */ - static std::vector<float> - band_pass_2(double gain, - double sampling_freq, - double low_cutoff_freq, // Hz beginning transition band - double high_cutoff_freq, // Hz beginning transition band - double transition_width, // Hz width of transition band - double attenuation_dB, // out of band attenuation dB - win_type window = WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + band_pass_2(double gain, + double sampling_freq, + double low_cutoff_freq, // Hz beginning transition band + double high_cutoff_freq, // Hz beginning transition band + double transition_width, // Hz width of transition band + double attenuation_dB, // out of band attenuation dB + win_type window = WIN_HAMMING, + double beta = 6.76); // used only with Kaiser /*! - * \brief use "window method" to design a complex band-pass FIR filter + * \brief Use the "window method" to design a complex band-pass FIR + * filter. The normalized width of the transition band is what sets the + * number of taps required. Narrow --> more taps. The window type + * determines maximum attenuation and passband ripple. * - * \p gain: overall gain of filter (typically 1.0) - * \p sampling_freq: sampling freq (Hz) - * \p low_cutoff_freq: center of transition band (Hz) - * \p high_cutoff_freq: center of transition band (Hz) - * \p transition_width: width of transition band (Hz). - * The normalized width of the transition - * band is what sets the number of taps - * required. Narrow --> more taps - * \p window_type: What kind of window to use. Determines - * maximum attenuation and passband ripple. - * \p beta: parameter for Kaiser window + * \param gain overall gain of filter (typically 1.0) + * \param sampling_freq sampling freq (Hz) + * \param low_cutoff_freq center of transition band (Hz) + * \param high_cutoff_freq center of transition band (Hz) + * \param transition_width width of transition band (Hz) + * \param window one of firdes::win_type + * \param beta parameter for Kaiser window */ static std::vector<gr_complex> - complex_band_pass(double gain, - double sampling_freq, - double low_cutoff_freq, // Hz center of transition band - double high_cutoff_freq, // Hz center of transition band - double transition_width, // Hz width of transition band - win_type window = WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + complex_band_pass(double gain, + double sampling_freq, + double low_cutoff_freq, // Hz center of transition band + double high_cutoff_freq, // Hz center of transition band + double transition_width, // Hz width of transition band + win_type window = WIN_HAMMING, + double beta = 6.76); // used only with Kaiser /*! - * \brief use "window method" to design a complex band-pass FIR filter + * \brief Use "window method" to design a complex band-pass FIR filter. + * The normalized width of the transition band and the required stop band + * attenuation is what sets the number of taps required. Narrow --> more + * taps More attenuation --> more taps. Window type determines maximum + * attenuation and passband ripple. * - * \p gain: overall gain of filter (typically 1.0) - * \p sampling_freq: sampling freq (Hz) - * \p low_cutoff_freq: center of transition band (Hz) - * \p high_cutoff_freq: center of transition band (Hz) - * \p transition_width: width of transition band (Hz). - * \p attenuation_dB out of band attenuation - * The normalized width of the transition - * band and the required stop band - * attenuation is what sets the number of taps - * required. Narrow --> more taps - * More attenuation --> more taps - * \p window_type: What kind of window to use. Determines - * maximum attenuation and passband ripple. - * \p beta: parameter for Kaiser window + * \param gain overall gain of filter (typically 1.0) + * \param sampling_freq sampling freq (Hz) + * \param low_cutoff_freq center of transition band (Hz) + * \param high_cutoff_freq center of transition band (Hz) + * \param transition_width width of transition band (Hz) + * \param attenuation_dB out of band attenuation + * \param window one of firdes::win_type + * \param beta parameter for Kaiser window */ - static std::vector<gr_complex> - complex_band_pass_2(double gain, - double sampling_freq, - double low_cutoff_freq, // Hz beginning transition band - double high_cutoff_freq, // Hz beginning transition band - double transition_width, // Hz width of transition band - double attenuation_dB, // out of band attenuation dB - win_type window = WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + complex_band_pass_2(double gain, + double sampling_freq, + double low_cutoff_freq, // Hz beginning transition band + double high_cutoff_freq, // Hz beginning transition band + double transition_width, // Hz width of transition band + double attenuation_dB, // out of band attenuation dB + win_type window = WIN_HAMMING, + double beta = 6.76); // used only with Kaiser /*! - * \brief use "window method" to design a band-reject FIR filter + * \brief Use "window method" to design a band-reject FIR filter. The + * normalized width of the transition band is what sets the number of + * taps required. Narrow --> more taps. Window type determines maximum + * attenuation and passband ripple. * - * \p gain: overall gain of filter (typically 1.0) - * \p sampling_freq: sampling freq (Hz) - * \p low_cutoff_freq: center of transition band (Hz) - * \p high_cutoff_freq: center of transition band (Hz) - * \p transition_width: width of transition band (Hz). - * The normalized width of the transition - * band is what sets the number of taps - * required. Narrow --> more taps - * \p window_type: What kind of window to use. Determines - * maximum attenuation and passband ripple. - * \p beta: parameter for Kaiser window + * \param gain overall gain of filter (typically 1.0) + * \param sampling_freq sampling freq (Hz) + * \param low_cutoff_freq center of transition band (Hz) + * \param high_cutoff_freq center of transition band (Hz) + * \param transition_width width of transition band (Hz) + * \param window one of firdes::win_type + * \param beta parameter for Kaiser window */ - static std::vector<float> - band_reject(double gain, - double sampling_freq, - double low_cutoff_freq, // Hz center of transition band - double high_cutoff_freq, // Hz center of transition band - double transition_width, // Hz width of transition band - win_type window = WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + band_reject(double gain, + double sampling_freq, + double low_cutoff_freq, // Hz center of transition band + double high_cutoff_freq, // Hz center of transition band + double transition_width, // Hz width of transition band + win_type window = WIN_HAMMING, + double beta = 6.76); // used only with Kaiser /*! - * \brief use "window method" to design a band-reject FIR filter + * \brief Use "window method" to design a band-reject FIR filter. The + * normalized width of the transition band and the required stop band + * attenuation is what sets the number of taps required. Narrow --> more + * taps More attenuation --> more taps. Window type determines maximum + * attenuation and passband ripple. * - * \p gain: overall gain of filter (typically 1.0) - * \p sampling_freq: sampling freq (Hz) - * \p low_cutoff_freq: center of transition band (Hz) - * \p high_cutoff_freq: center of transition band (Hz) - * \p transition_width: width of transition band (Hz). - * \p attenuation_dB out of band attenuation - * The normalized width of the transition - * band and the required stop band - * attenuation is what sets the number of taps - * required. Narrow --> more taps - * More attenuation --> more taps - * \p window_type: What kind of window to use. Determines - * maximum attenuation and passband ripple. - * \p beta: parameter for Kaiser window + * \param gain overall gain of filter (typically 1.0) + * \param sampling_freq sampling freq (Hz) + * \param low_cutoff_freq center of transition band (Hz) + * \param high_cutoff_freq center of transition band (Hz) + * \param transition_width width of transition band (Hz). + * \param attenuation_dB out of band attenuation + * \param window one of firdes::win_type + * \param beta parameter for Kaiser window */ - static std::vector<float> - band_reject_2(double gain, - double sampling_freq, - double low_cutoff_freq, // Hz beginning transition band - double high_cutoff_freq, // Hz beginning transition band - double transition_width, // Hz width of transition band - double attenuation_dB, // out of band attenuation dB - win_type window = WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + band_reject_2(double gain, + double sampling_freq, + double low_cutoff_freq, // Hz beginning transition band + double high_cutoff_freq, // Hz beginning transition band + double transition_width, // Hz width of transition band + double attenuation_dB, // out of band attenuation dB + win_type window = WIN_HAMMING, + double beta = 6.76); // used only with Kaiser /*!\brief design a Hilbert Transform Filter * - * \p ntaps: Number of taps, must be odd - * \p window_type: What kind of window to use - * \p beta: Only used for Kaiser + * \param ntaps number of taps, must be odd + * \param windowtype one kind of firdes::win_type + * \param beta parameter for Kaiser window */ static std::vector<float> - hilbert(unsigned int ntaps = 19, - win_type windowtype = WIN_RECTANGULAR, - double beta = 6.76); + hilbert(unsigned int ntaps = 19, + win_type windowtype = WIN_RECTANGULAR, + double beta = 6.76); /*! * \brief design a Root Cosine FIR Filter (do we need a window?) * - * \p gain: overall gain of filter (typically 1.0) - * \p sampling_freq: sampling freq (Hz) - * \p symbol rate: symbol rate, must be a factor of sample rate - * \p alpha: excess bandwidth factor - * \p ntaps: number of taps + * \param gain overall gain of filter (typically 1.0) + * \param sampling_freq sampling freq (Hz) + * \param symbol_rate symbol rate, must be a factor of sample rate + * \param alpha excess bandwidth factor + * \param ntaps number of taps */ static std::vector<float> - root_raised_cosine(double gain, - double sampling_freq, - double symbol_rate, // Symbol rate, NOT bitrate (unless BPSK) - double alpha, // Excess Bandwidth Factor - int ntaps); + root_raised_cosine(double gain, + double sampling_freq, + double symbol_rate, // Symbol rate, NOT bitrate (unless BPSK) + double alpha, // Excess Bandwidth Factor + int ntaps); /*! * \brief design a Gaussian filter * - * \p gain: overall gain of filter (typically 1.0) - * \p symbols per bit: symbol rate, must be a factor of sample rate - * \p ntaps: number of taps + * \param gain overall gain of filter (typically 1.0) + * \param spb symbol rate, must be a factor of sample rate + * \param bt bandwidth to bitrate ratio + * \param ntaps number of taps */ static std::vector<float> - gaussian(double gain, - double spb, - double bt, // Bandwidth to bitrate ratio - int ntaps); + gaussian(double gain, + double spb, + double bt, // Bandwidth to bitrate ratio + int ntaps); private: static double bessi0(double x); diff --git a/gr-filter/lib/firdes.cc b/gr-filter/lib/firdes.cc index 351eb7a71d..323de42509 100644 --- a/gr-filter/lib/firdes.cc +++ b/gr-filter/lib/firdes.cc @@ -590,13 +590,13 @@ namespace gr { double t0 = -0.5 * ntaps; double ts; for(int i=0;i<ntaps;i++) { - t0++; - ts = s*dt*t0; - taps[i] = exp(-0.5*ts*ts); - scale += taps[i]; + t0++; + ts = s*dt*t0; + taps[i] = exp(-0.5*ts*ts); + scale += taps[i]; } for(int i=0;i<ntaps;i++) - taps[i] = taps[i] / scale * gain; + taps[i] = taps[i] / scale * gain; return taps; } diff --git a/grc/base/Element.py b/grc/base/Element.py index 04a3690282..b0f94d0183 100644 --- a/grc/base/Element.py +++ b/grc/base/Element.py @@ -39,9 +39,9 @@ class Element(object): Is this element valid? Returns: - true when the element is enabled and has no error messages + true when the element is enabled and has no error messages or is bypassed """ - return not self.get_error_messages() or not self.get_enabled() + return (not self.get_error_messages() or not self.get_enabled()) or self.get_bypassed() def add_error_message(self, msg): """ @@ -55,14 +55,14 @@ class Element(object): def get_error_messages(self): """ Get the list of error messages from this element and all of its children. - Do not include the error messages from disabled children. + Do not include the error messages from disabled or bypassed children. Cleverly indent the children error messages for printing purposes. Returns: a list of error message strings """ error_messages = list(self._error_messages) #make a copy - for child in filter(lambda c: c.get_enabled(), self.get_children()): + for child in filter(lambda c: c.get_enabled() and not c.get_bypassed(), self.get_children()): for msg in child.get_error_messages(): error_messages.append("%s:\n\t%s"%(child, msg.replace("\n", "\n\t"))) return error_messages @@ -75,6 +75,7 @@ class Element(object): for child in self.get_children(): child.rewrite() def get_enabled(self): return True + def get_bypassed(self): return False ############################################## ## Tree-like API |