diff options
author | Jacob Gilbert <jacob.gilbert@protonmail.com> | 2021-01-23 07:59:51 -0800 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-01-25 07:51:48 -0500 |
commit | a0ddd54ffda45fe843ddede10cec8f4f38319210 (patch) | |
tree | 874ae2944ff49e38a817a10c39a9f1044d6da50d /gr-filter | |
parent | b464b6a450a718019647418e6eff3f437f9ae0ae (diff) |
gr-filter: update for additional window values
Recently added window options include several additional windows that take a configuration parameter. This updates this parameter from 'beta' which was previously used only for Kaiser windows to a generic 'param' which makes sense for any window requiring a configuration parameter. The default values remain 6.76 which is not legal for the Tukey window but this error will be caught if the default is used; this is a reasonable cost for backward compatability.
Signed-off-by: Jacob Gilbert <jacob.gilbert@protonmail.com>
Diffstat (limited to 'gr-filter')
-rw-r--r-- | gr-filter/include/gnuradio/filter/firdes.h | 104 | ||||
-rw-r--r-- | gr-filter/include/gnuradio/filter/hilbert_fc.h | 4 | ||||
-rw-r--r-- | gr-filter/lib/firdes.cc | 83 | ||||
-rw-r--r-- | gr-filter/lib/hilbert_fc_impl.cc | 8 | ||||
-rw-r--r-- | gr-filter/lib/hilbert_fc_impl.h | 2 | ||||
-rw-r--r-- | gr-filter/python/filter/bindings/firdes_python.cc | 30 | ||||
-rw-r--r-- | gr-filter/python/filter/bindings/hilbert_fc_python.cc | 4 |
7 files changed, 117 insertions, 118 deletions
diff --git a/gr-filter/include/gnuradio/filter/firdes.h b/gr-filter/include/gnuradio/filter/firdes.h index 37521098ef..e76e6e26e0 100644 --- a/gr-filter/include/gnuradio/filter/firdes.h +++ b/gr-filter/include/gnuradio/filter/firdes.h @@ -28,7 +28,7 @@ namespace filter { class FILTER_API firdes { public: - static std::vector<float> window(fft::window::win_type type, int ntaps, double beta); + static std::vector<float> window(fft::window::win_type type, int ntaps, double param); // ... class methods ... @@ -40,10 +40,10 @@ public: * * \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 cutoff_freq center of transition band (Hz) + * \param transition_width width of transition band (Hz) * \param window one of fft::window::win_type - * \param beta parameter for Kaiser window + * \param param parameter for Kaiser, Exp., Gaussian, Tukey windows */ static std::vector<float> low_pass(double gain, @@ -51,7 +51,7 @@ public: double cutoff_freq, // Hz center of transition band double transition_width, // Hz width of transition band fft::window::win_type window = fft::window::win_type::WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + double param = 6.76); // used for Kaiser, Exp., Gaussian, Tukey windows /*! * \brief Use "window method" to design a low-pass FIR filter. The @@ -66,7 +66,7 @@ public: * \param transition_width width of transition band (Hz) * \param attenuation_dB required stopband attenuation * \param window one of fft::window::win_type - * \param beta parameter for Kaiser window + * \param param parameter for Kaiser, Exp., Gaussian, Tukey windows */ static std::vector<float> low_pass_2(double gain, @@ -75,7 +75,7 @@ public: double transition_width, // Hz width of transition band double attenuation_dB, // out of band attenuation dB fft::window::win_type window = fft::window::win_type::WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + double param = 6.76); // used for Kaiser, Exp., Gaussian, Tukey windows /*! * \brief Use "window method" to design a high-pass FIR filter. The @@ -88,7 +88,7 @@ public: * \param cutoff_freq center of transition band (Hz) * \param transition_width width of transition band (Hz) * \param window one of fft::window::win_type - * \param beta parameter for Kaiser window + * \param param parameter for Kaiser, Exp., Gaussian, Tukey windows */ static std::vector<float> high_pass(double gain, @@ -96,7 +96,7 @@ public: double cutoff_freq, // Hz center of transition band double transition_width, // Hz width of transition band fft::window::win_type window = fft::window::win_type::WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + double param = 6.76); // used for Kaiser, Exp., Gaussian, Tukey windows /*! * \brief Use "window method" to design a high-pass FIR filter. The @@ -111,7 +111,7 @@ public: * \param transition_width width of transition band (Hz). * \param attenuation_dB out of band attenuation * \param window one of fft::window::win_type - * \param beta parameter for Kaiser window + * \param param parameter for Kaiser, Exp., Gaussian, Tukey windows */ static std::vector<float> high_pass_2(double gain, @@ -120,7 +120,7 @@ public: double transition_width, // Hz width of transition band double attenuation_dB, // out of band attenuation dB fft::window::win_type window = fft::window::win_type::WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + double param = 6.76); // used for Kaiser, Exp., Gaussian, Tukey windows /*! * \brief Use "window method" to design a band-pass FIR filter. The @@ -134,7 +134,7 @@ public: * \param high_cutoff_freq center of transition band (Hz) * \param transition_width width of transition band (Hz). * \param window one of fft::window::win_type - * \param beta parameter for Kaiser window + * \param param parameter for Kaiser, Exp., Gaussian, Tukey windows */ static std::vector<float> band_pass(double gain, @@ -143,7 +143,7 @@ public: double high_cutoff_freq, // Hz center of transition band double transition_width, // Hz width of transition band fft::window::win_type window = fft::window::win_type::WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + double param = 6.76); // used for Kaiser, Exp., Gaussian, Tukey windows /*! * \brief Use "window method" to design a band-pass FIR filter. The @@ -159,7 +159,7 @@ public: * \param transition_width width of transition band (Hz). * \param attenuation_dB out of band attenuation * \param window one of fft::window::win_type - * \param beta parameter for Kaiser window + * \param param parameter for Kaiser, Exp., Gaussian, Tukey windows */ static std::vector<float> band_pass_2(double gain, @@ -169,7 +169,7 @@ public: double transition_width, // Hz width of transition band double attenuation_dB, // out of band attenuation dB fft::window::win_type window = fft::window::win_type::WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + double param = 6.76); // used for Kaiser, Exp., Gaussian, Tukey windows /*! * \brief Use the "window method" to design a complex band-reject FIR * filter. The normalized width of the transition band is what sets the @@ -182,16 +182,16 @@ public: * \param high_cutoff_freq center of transition band (Hz) * \param transition_width width of transition band (Hz) * \param window one of fft::window::win_type - * \param beta parameter for Kaiser window + * \param param parameter for Kaiser, Exp., Gaussian, Tukey windows */ - static std::vector<gr_complex> - complex_band_reject(double gain, - double sampling_freq, - double low_cutoff_freq, - double high_cutoff_freq, - double transition_width, // Hz width of transition band - fft::window::win_type window = fft::window::win_type::WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + static std::vector<gr_complex> complex_band_reject( + double gain, + double sampling_freq, + double low_cutoff_freq, + double high_cutoff_freq, + double transition_width, // Hz width of transition band + fft::window::win_type window = fft::window::win_type::WIN_HAMMING, + double param = 6.76); // used for Kaiser, Exp., Gaussian, Tukey windows /*! * \brief Use "window method" to design a complex band-reject FIR filter. @@ -207,7 +207,7 @@ public: * \param transition_width width of transition band (Hz) * \param attenuation_dB out of band attenuation * \param window one of fft::window::win_type - * \param beta parameter for Kaiser window + * \param param parameter for Kaiser, Exp., Gaussian, Tukey windows */ static std::vector<gr_complex> complex_band_reject_2( double gain, @@ -217,7 +217,7 @@ public: double transition_width, // Hz width of transition band double attenuation_dB, // out of band attenuation dB fft::window::win_type window = fft::window::win_type::WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + double param = 6.76); // used for Kaiser, Exp., Gaussian, Tukey windows /*! * \brief Use the "window method" to design a complex band-pass FIR @@ -231,16 +231,16 @@ public: * \param high_cutoff_freq center of transition band (Hz) * \param transition_width width of transition band (Hz) * \param window one of fft::window::win_type - * \param beta parameter for Kaiser window + * \param param parameter for Kaiser, Exp., Gaussian, Tukey windows */ - 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 - fft::window::win_type window = fft::window::win_type::WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + 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 + fft::window::win_type window = fft::window::win_type::WIN_HAMMING, + double param = 6.76); // used for Kaiser, Exp., Gaussian, Tukey windows /*! * \brief Use "window method" to design a complex band-pass FIR filter. @@ -256,17 +256,17 @@ public: * \param transition_width width of transition band (Hz) * \param attenuation_dB out of band attenuation * \param window one of fft::window::win_type - * \param beta parameter for Kaiser window + * \param param parameter for Kaiser, Exp., Gaussian, Tukey windows */ - 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 - fft::window::win_type window = fft::window::win_type::WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + 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 + fft::window::win_type window = fft::window::win_type::WIN_HAMMING, + double param = 6.76); // used for Kaiser, Exp., Gaussian, Tukey windows /*! * \brief Use "window method" to design a band-reject FIR filter. The @@ -280,7 +280,7 @@ public: * \param high_cutoff_freq center of transition band (Hz) * \param transition_width width of transition band (Hz) * \param window one of fft::window::win_type - * \param beta parameter for Kaiser window + * \param param parameter for Kaiser, Exp., Gaussian, Tukey windows */ static std::vector<float> band_reject(double gain, @@ -289,7 +289,7 @@ public: double high_cutoff_freq, // Hz center of transition band double transition_width, // Hz width of transition band fft::window::win_type window = fft::window::win_type::WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + double param = 6.76); // used for Kaiser, Exp., Gaussian, Tukey windows /*! * \brief Use "window method" to design a band-reject FIR filter. The @@ -305,7 +305,7 @@ public: * \param transition_width width of transition band (Hz). * \param attenuation_dB out of band attenuation * \param window one of fft::window::win_type - * \param beta parameter for Kaiser window + * \param param parameter for Kaiser, Exp., Gaussian, Tukey windows */ static std::vector<float> band_reject_2(double gain, @@ -315,18 +315,18 @@ public: double transition_width, // Hz width of transition band double attenuation_dB, // out of band attenuation dB fft::window::win_type window = fft::window::win_type::WIN_HAMMING, - double beta = 6.76); // used only with Kaiser + double param = 6.76); // used for Kaiser, Exp., Gaussian, Tukey windows /*!\brief design a Hilbert Transform Filter * * \param ntaps number of taps, must be odd * \param windowtype one kind of fft::window::win_type - * \param beta parameter for Kaiser window + * \param param parameter for Kaiser, Exp., Gaussian, Tukey windows */ static std::vector<float> hilbert(unsigned int ntaps = 19, fft::window::win_type windowtype = fft::window::win_type::WIN_RECTANGULAR, - double beta = 6.76); + double param = 6.76); /*! * \brief design a Root Cosine FIR Filter (do we need a window?) @@ -370,7 +370,7 @@ private: static int compute_ntaps(double sampling_freq, double transition_width, fft::window::win_type window_type, - double beta); + double param); static int compute_ntaps_windes(double sampling_freq, double transition_width, diff --git a/gr-filter/include/gnuradio/filter/hilbert_fc.h b/gr-filter/include/gnuradio/filter/hilbert_fc.h index a365fcb79b..e333d9bd47 100644 --- a/gr-filter/include/gnuradio/filter/hilbert_fc.h +++ b/gr-filter/include/gnuradio/filter/hilbert_fc.h @@ -40,11 +40,11 @@ public: * * \param ntaps The number of taps for the filter. * \param window Window type (see fft::window::win_type) to use. - * \param beta Beta value for a Kaiser window. + * \param param Parameter value for a Kaiser/Exp/Gaussian/Tukey window. */ static sptr make(unsigned int ntaps, fft::window::win_type window = fft::window::win_type::WIN_HAMMING, - double beta = 6.76); + double param = 6.76); }; } /* namespace filter */ diff --git a/gr-filter/lib/firdes.cc b/gr-filter/lib/firdes.cc index 4b29cccaab..e68ec5ee16 100644 --- a/gr-filter/lib/firdes.cc +++ b/gr-filter/lib/firdes.cc @@ -21,9 +21,9 @@ using std::vector; namespace gr { namespace filter { -std::vector<float> firdes::window(fft::window::win_type type, int ntaps, double beta) +std::vector<float> firdes::window(fft::window::win_type type, int ntaps, double param) { - return fft::window::build(type, ntaps, beta); + return fft::window::build(type, ntaps, param); } // @@ -36,7 +36,7 @@ vector<float> firdes::low_pass_2(double gain, double transition_width, // Hz width of transition band double attenuation_dB, // attenuation dB fft::window::win_type window_type, - double beta) // used only with Kaiser + double param) // used with Kaiser, Exp., Gaussian, Tukey { sanity_check_1f(sampling_freq, cutoff_freq, transition_width); @@ -46,7 +46,7 @@ vector<float> firdes::low_pass_2(double gain, // [sin(x)/x for the low pass case] vector<float> taps(ntaps); - vector<float> w = window(window_type, ntaps, beta); + vector<float> w = window(window_type, ntaps, param); int M = (ntaps - 1) / 2; double fwT0 = 2 * GR_M_PI * cutoff_freq / sampling_freq; @@ -79,17 +79,16 @@ vector<float> firdes::low_pass(double gain, double cutoff_freq, // Hz center of transition band double transition_width, // Hz width of transition band fft::window::win_type window_type, - double beta) // used only with Kaiser + double param) // used with Kaiser, Exp., Gaussian, Tukey { sanity_check_1f(sampling_freq, cutoff_freq, transition_width); - int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, beta); - + int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, param); // construct the truncated ideal impulse response // [sin(x)/x for the low pass case] vector<float> taps(ntaps); - vector<float> w = window(window_type, ntaps, beta); + vector<float> w = window(window_type, ntaps, param); int M = (ntaps - 1) / 2; double fwT0 = 2 * GR_M_PI * cutoff_freq / sampling_freq; @@ -129,7 +128,7 @@ vector<float> firdes::high_pass_2(double gain, double transition_width, // Hz width of transition band double attenuation_dB, // attenuation dB fft::window::win_type window_type, - double beta) // used only with Kaiser + double param) // used with Kaiser, Exp., Gaussian, Tukey { sanity_check_1f(sampling_freq, cutoff_freq, transition_width); @@ -138,7 +137,7 @@ vector<float> firdes::high_pass_2(double gain, // construct the truncated ideal impulse response times the window function vector<float> taps(ntaps); - vector<float> w = window(window_type, ntaps, beta); + vector<float> w = window(window_type, ntaps, param); int M = (ntaps - 1) / 2; double fwT0 = 2 * GR_M_PI * cutoff_freq / sampling_freq; @@ -173,16 +172,16 @@ vector<float> firdes::high_pass(double gain, double cutoff_freq, // Hz center of transition band double transition_width, // Hz width of transition band fft::window::win_type window_type, - double beta) // used only with Kaiser + double param) // used with Kaiser, Exp., Gaussian, Tukey { sanity_check_1f(sampling_freq, cutoff_freq, transition_width); - int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, beta); + int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, param); // construct the truncated ideal impulse response times the window function vector<float> taps(ntaps); - vector<float> w = window(window_type, ntaps, beta); + vector<float> w = window(window_type, ntaps, param); int M = (ntaps - 1) / 2; double fwT0 = 2 * GR_M_PI * cutoff_freq / sampling_freq; @@ -222,14 +221,14 @@ vector<float> firdes::band_pass_2(double gain, double transition_width, // Hz width of transition band double attenuation_dB, // attenuation dB fft::window::win_type window_type, - double beta) // used only with Kaiser + double param) // used with Kaiser, Exp., Gaussian, Tukey { sanity_check_2f(sampling_freq, low_cutoff_freq, high_cutoff_freq, transition_width); int ntaps = compute_ntaps_windes(sampling_freq, transition_width, attenuation_dB); vector<float> taps(ntaps); - vector<float> w = window(window_type, ntaps, beta); + vector<float> w = window(window_type, ntaps, param); int M = (ntaps - 1) / 2; double fwT0 = 2 * GR_M_PI * low_cutoff_freq / sampling_freq; @@ -265,16 +264,16 @@ vector<float> firdes::band_pass(double gain, double high_cutoff_freq, // Hz center of transition band double transition_width, // Hz width of transition band fft::window::win_type window_type, - double beta) // used only with Kaiser + double param) // used with Kaiser, Exp., Gaussian, Tukey { sanity_check_2f(sampling_freq, low_cutoff_freq, high_cutoff_freq, transition_width); - int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, beta); + int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, param); // construct the truncated ideal impulse response times the window function vector<float> taps(ntaps); - vector<float> w = window(window_type, ntaps, beta); + vector<float> w = window(window_type, ntaps, param); int M = (ntaps - 1) / 2; double fwT0 = 2 * GR_M_PI * low_cutoff_freq / sampling_freq; @@ -315,7 +314,7 @@ firdes::complex_band_pass_2(double gain, double transition_width, // Hz width of transition band double attenuation_dB, // attenuation dB fft::window::win_type window_type, - double beta) // used only with Kaiser + double param) // used with Kaiser, Exp., Gaussian, Tukey { sanity_check_2f_c(sampling_freq, low_cutoff_freq, high_cutoff_freq, transition_width); @@ -323,7 +322,7 @@ firdes::complex_band_pass_2(double gain, vector<gr_complex> taps(ntaps); vector<float> lptaps(ntaps); - vector<float> w = window(window_type, ntaps, beta); + vector<float> w = window(window_type, ntaps, param); lptaps = low_pass_2(gain, sampling_freq, @@ -331,7 +330,7 @@ firdes::complex_band_pass_2(double gain, transition_width, attenuation_dB, window_type, - beta); + param); gr_complex* optr = &taps[0]; float* iptr = &lptaps[0]; @@ -358,24 +357,24 @@ firdes::complex_band_pass(double gain, double high_cutoff_freq, // Hz center of transition band double transition_width, // Hz width of transition band fft::window::win_type window_type, - double beta) // used only with Kaiser + double param) // used with Kaiser, Exp., Gaussian, Tukey { sanity_check_2f_c(sampling_freq, low_cutoff_freq, high_cutoff_freq, transition_width); - int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, beta); + int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, param); // construct the truncated ideal impulse response times the window function vector<gr_complex> taps(ntaps); vector<float> lptaps(ntaps); - vector<float> w = window(window_type, ntaps, beta); + vector<float> w = window(window_type, ntaps, param); lptaps = low_pass(gain, sampling_freq, (high_cutoff_freq - low_cutoff_freq) / 2, transition_width, window_type, - beta); + param); gr_complex* optr = &taps[0]; float* iptr = &lptaps[0]; @@ -406,17 +405,17 @@ firdes::complex_band_reject_2(double gain, double transition_width, // Hz width of transition band double attenuation_dB, // attenuation dB fft::window::win_type window_type, - double beta) // used only with Kaiser + double param) // used with Kaiser, Exp., Gaussian, Tukey { sanity_check_2f_c(sampling_freq, low_cutoff_freq, high_cutoff_freq, transition_width); - int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, beta); + int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, param); // construct the truncated ideal impulse response times the window function vector<gr_complex> taps(ntaps); vector<float> hptaps(ntaps); - vector<float> w = window(window_type, ntaps, beta); + vector<float> w = window(window_type, ntaps, param); hptaps = high_pass_2(gain, sampling_freq, @@ -424,7 +423,7 @@ firdes::complex_band_reject_2(double gain, transition_width, attenuation_dB, window_type, - beta); + param); gr_complex* optr = &taps[0]; float* iptr = &hptaps[0]; @@ -450,24 +449,24 @@ firdes::complex_band_reject(double gain, double high_cutoff_freq, // Hz center of transition band double transition_width, // Hz width of transition band fft::window::win_type window_type, - double beta) // used only with Kaiser + double param) // used with Kaiser, Exp., Gaussian, Tukey { sanity_check_2f_c(sampling_freq, low_cutoff_freq, high_cutoff_freq, transition_width); - int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, beta); + int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, param); // construct the truncated ideal impulse response times the window function vector<gr_complex> taps(ntaps); vector<float> hptaps(ntaps); - vector<float> w = window(window_type, ntaps, beta); + vector<float> w = window(window_type, ntaps, param); hptaps = high_pass(gain, sampling_freq, (high_cutoff_freq - low_cutoff_freq) / 2, transition_width, window_type, - beta); + param); gr_complex* optr = &taps[0]; float* iptr = &hptaps[0]; @@ -498,7 +497,7 @@ firdes::band_reject_2(double gain, double transition_width, // Hz width of transition band double attenuation_dB, // attenuation dB fft::window::win_type window_type, - double beta) // used only with Kaiser + double param) // used with Kaiser, Exp., Gaussian, Tukey { sanity_check_2f(sampling_freq, low_cutoff_freq, high_cutoff_freq, transition_width); @@ -507,7 +506,7 @@ firdes::band_reject_2(double gain, // construct the truncated ideal impulse response times the window function vector<float> taps(ntaps); - vector<float> w = window(window_type, ntaps, beta); + vector<float> w = window(window_type, ntaps, param); int M = (ntaps - 1) / 2; double fwT0 = 2 * GR_M_PI * low_cutoff_freq / sampling_freq; @@ -542,16 +541,16 @@ vector<float> firdes::band_reject(double gain, double high_cutoff_freq, // Hz center of transition band double transition_width, // Hz width of transition band fft::window::win_type window_type, - double beta) // used only with Kaiser + double param) // used with Kaiser, Exp., Gaussian, Tukey { sanity_check_2f(sampling_freq, low_cutoff_freq, high_cutoff_freq, transition_width); - int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, beta); + int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, param); // construct the truncated ideal impulse response times the window function vector<float> taps(ntaps); - vector<float> w = window(window_type, ntaps, beta); + vector<float> w = window(window_type, ntaps, param); int M = (ntaps - 1) / 2; double fwT0 = 2 * GR_M_PI * low_cutoff_freq / sampling_freq; @@ -585,13 +584,13 @@ vector<float> firdes::band_reject(double gain, // vector<float> -firdes::hilbert(unsigned int ntaps, fft::window::win_type windowtype, double beta) +firdes::hilbert(unsigned int ntaps, fft::window::win_type windowtype, double param) { if (!(ntaps & 1)) throw std::out_of_range("Hilbert: Must have odd number of taps"); vector<float> taps(ntaps); - vector<float> w = window(windowtype, ntaps, beta); + vector<float> w = window(windowtype, ntaps, param); unsigned int h = (ntaps - 1) / 2; float gain = 0; for (unsigned int i = 1; i <= h; i++) { @@ -704,9 +703,9 @@ int firdes::compute_ntaps_windes( int firdes::compute_ntaps(double sampling_freq, double transition_width, fft::window::win_type window_type, - double beta) + double param) { - double a = fft::window::max_attenuation(window_type, beta); + double a = fft::window::max_attenuation(window_type, param); int ntaps = (int)(a * sampling_freq / (22.0 * transition_width)); if ((ntaps & 1) == 0) // if even... ntaps++; // ...make odd diff --git a/gr-filter/lib/hilbert_fc_impl.cc b/gr-filter/lib/hilbert_fc_impl.cc index b60b1a0cb1..4cc1ef6ef3 100644 --- a/gr-filter/lib/hilbert_fc_impl.cc +++ b/gr-filter/lib/hilbert_fc_impl.cc @@ -21,19 +21,19 @@ namespace gr { namespace filter { hilbert_fc::sptr -hilbert_fc::make(unsigned int ntaps, fft::window::win_type window, double beta) +hilbert_fc::make(unsigned int ntaps, fft::window::win_type window, double param) { - return gnuradio::make_block_sptr<hilbert_fc_impl>(ntaps, window, beta); + return gnuradio::make_block_sptr<hilbert_fc_impl>(ntaps, window, param); } hilbert_fc_impl::hilbert_fc_impl(unsigned int ntaps, fft::window::win_type window, - double beta) + double param) : sync_block("hilbert_fc", io_signature::make(1, 1, sizeof(float)), io_signature::make(1, 1, sizeof(gr_complex))), d_ntaps(ntaps | 0x1), // ensure ntaps is odd - d_hilb(firdes::hilbert(d_ntaps, window, beta)) + d_hilb(firdes::hilbert(d_ntaps, window, param)) { set_history(d_ntaps); diff --git a/gr-filter/lib/hilbert_fc_impl.h b/gr-filter/lib/hilbert_fc_impl.h index bd0f2415fa..ebaa3c0518 100644 --- a/gr-filter/lib/hilbert_fc_impl.h +++ b/gr-filter/lib/hilbert_fc_impl.h @@ -28,7 +28,7 @@ private: public: hilbert_fc_impl(unsigned int ntaps, fft::window::win_type window = fft::window::WIN_HAMMING, - double beta = 6.76); + double param = 6.76); int work(int noutput_items, gr_vector_const_void_star& input_items, diff --git a/gr-filter/python/filter/bindings/firdes_python.cc b/gr-filter/python/filter/bindings/firdes_python.cc index fc7cf78866..cf8fd39444 100644 --- a/gr-filter/python/filter/bindings/firdes_python.cc +++ b/gr-filter/python/filter/bindings/firdes_python.cc @@ -14,7 +14,7 @@ /* BINDTOOL_GEN_AUTOMATIC(0) */ /* BINDTOOL_USE_PYGCCXML(0) */ /* BINDTOOL_HEADER_FILE(firdes.h) */ -/* BINDTOOL_HEADER_FILE_HASH(afeccb5d25e3c88b1dcfc23d3542ec0b) */ +/* BINDTOOL_HEADER_FILE_HASH(10cf0c4b9664ba7e2931c2375c13c68c) */ /***********************************************************************************/ #include <pybind11/complex.h> @@ -38,7 +38,7 @@ void bind_firdes(py::module& m) &firdes::window, py::arg("type"), py::arg("ntaps"), - py::arg("beta"), + py::arg("param"), D(firdes, window)) @@ -49,7 +49,7 @@ void bind_firdes(py::module& m) py::arg("cutoff_freq"), py::arg("transition_width"), py::arg("window") = ::gr::fft::window::win_type::WIN_HAMMING, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(firdes, low_pass)) @@ -61,7 +61,7 @@ void bind_firdes(py::module& m) py::arg("transition_width"), py::arg("attenuation_dB"), py::arg("window") = ::gr::fft::window::win_type::WIN_HAMMING, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(firdes, low_pass_2)) @@ -72,7 +72,7 @@ void bind_firdes(py::module& m) py::arg("cutoff_freq"), py::arg("transition_width"), py::arg("window") = ::gr::fft::window::win_type::WIN_HAMMING, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(firdes, high_pass)) @@ -84,7 +84,7 @@ void bind_firdes(py::module& m) py::arg("transition_width"), py::arg("attenuation_dB"), py::arg("window") = ::gr::fft::window::win_type::WIN_HAMMING, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(firdes, high_pass_2)) @@ -96,7 +96,7 @@ void bind_firdes(py::module& m) py::arg("high_cutoff_freq"), py::arg("transition_width"), py::arg("window") = ::gr::fft::window::win_type::WIN_HAMMING, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(firdes, band_pass)) @@ -109,7 +109,7 @@ void bind_firdes(py::module& m) py::arg("transition_width"), py::arg("attenuation_dB"), py::arg("window") = ::gr::fft::window::win_type::WIN_HAMMING, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(firdes, band_pass_2)) @@ -121,7 +121,7 @@ void bind_firdes(py::module& m) py::arg("high_cutoff_freq"), py::arg("transition_width"), py::arg("window") = ::gr::fft::window::win_type::WIN_HAMMING, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(firdes, complex_band_pass)) @@ -134,7 +134,7 @@ void bind_firdes(py::module& m) py::arg("transition_width"), py::arg("attenuation_dB"), py::arg("window") = ::gr::fft::window::win_type::WIN_HAMMING, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(firdes, complex_band_pass_2)) @@ -146,7 +146,7 @@ void bind_firdes(py::module& m) py::arg("high_cutoff_freq"), py::arg("transition_width"), py::arg("window") = ::gr::fft::window::win_type::WIN_HAMMING, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(firdes, band_reject)) @@ -159,7 +159,7 @@ void bind_firdes(py::module& m) py::arg("transition_width"), py::arg("attenuation_dB"), py::arg("window") = ::gr::fft::window::win_type::WIN_HAMMING, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(firdes, band_reject_2)) @@ -171,7 +171,7 @@ void bind_firdes(py::module& m) py::arg("high_cutoff_freq"), py::arg("transition_width"), py::arg("window") = ::gr::fft::window::win_type::WIN_HAMMING, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(firdes, complex_band_reject)) @@ -184,7 +184,7 @@ void bind_firdes(py::module& m) py::arg("transition_width"), py::arg("attenuation_dB"), py::arg("window") = ::gr::fft::window::win_type::WIN_HAMMING, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(firdes, complex_band_reject_2)) @@ -192,7 +192,7 @@ void bind_firdes(py::module& m) &firdes::hilbert, py::arg("ntaps") = 19, py::arg("windowtype") = ::gr::fft::window::win_type::WIN_RECTANGULAR, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(firdes, hilbert)) diff --git a/gr-filter/python/filter/bindings/hilbert_fc_python.cc b/gr-filter/python/filter/bindings/hilbert_fc_python.cc index ceb660471b..b30e6f5ee0 100644 --- a/gr-filter/python/filter/bindings/hilbert_fc_python.cc +++ b/gr-filter/python/filter/bindings/hilbert_fc_python.cc @@ -14,7 +14,7 @@ /* BINDTOOL_GEN_AUTOMATIC(0) */ /* BINDTOOL_USE_PYGCCXML(0) */ /* BINDTOOL_HEADER_FILE(hilbert_fc.h) */ -/* BINDTOOL_HEADER_FILE_HASH(3f5ee100c05bf0b167c39a017a65b9eb) */ +/* BINDTOOL_HEADER_FILE_HASH(041e266d5e3108f725118a1f581b43f8) */ /***********************************************************************************/ #include <pybind11/complex.h> @@ -41,6 +41,6 @@ void bind_hilbert_fc(py::module& m) .def(py::init(&hilbert_fc::make), py::arg("ntaps"), py::arg("window") = ::gr::fft::window::win_type::WIN_HAMMING, - py::arg("beta") = 6.7599999999999998, + py::arg("param") = 6.7599999999999998, D(hilbert_fc, make)); } |