diff options
author | Tom Rondeau <tom@trondeau.com> | 2014-07-07 12:20:09 -0400 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2014-07-07 12:20:09 -0400 |
commit | bbfc759914da80214fabc70fbbed1edaf39f9e4b (patch) | |
tree | 712eb6d1d95445bb6535534ce86d7faf1bfe6f90 /gr-filter | |
parent | 3f469513b94ac992138360caca7e1b53f82214ae (diff) | |
parent | 597b93798a804cde1783d6d2ab53b348d57c44cd (diff) |
Merge branch 'maint'
Diffstat (limited to 'gr-filter')
98 files changed, 482 insertions, 482 deletions
diff --git a/gr-filter/apps/gr_filter_design b/gr-filter/apps/gr_filter_design index 0180119321..6799f74be8 100755 --- a/gr-filter/apps/gr_filter_design +++ b/gr-filter/apps/gr_filter_design @@ -20,7 +20,7 @@ # Boston, MA 02110-1301, USA. # -from gnuradio.filter import filter_design +from gnuradio.filter import filter_design import sys # Call filter desgin main function diff --git a/gr-filter/doc/filter.dox b/gr-filter/doc/filter.dox index a9b329836c..8d465ab896 100644 --- a/gr-filter/doc/filter.dox +++ b/gr-filter/doc/filter.dox @@ -217,7 +217,7 @@ example of this can be found in \b examples/filter/gr_filtdes_api.py. \code filtobj = filter_design.launch(sys.argv) -print "Filter Count:", filtobj.get_filtercount() +print "Filter Count:", filtobj.get_filtercount() print "Filter type:", filtobj.get_restype() print "Filter params", filtobj.get_params() print "Filter Coefficients", filtobj.get_taps() diff --git a/gr-filter/examples/fft_filter_ccc.py b/gr-filter/examples/fft_filter_ccc.py index 4979cfedda..00b0697b6c 100755 --- a/gr-filter/examples/fft_filter_ccc.py +++ b/gr-filter/examples/fft_filter_ccc.py @@ -112,7 +112,7 @@ def main(): s2.plot(data_snk.real, 'g') pylab.show() - + if __name__ == "__main__": try: main() diff --git a/gr-filter/examples/fir_filter_ccc.py b/gr-filter/examples/fir_filter_ccc.py index 2a9241858c..b295e299bb 100755 --- a/gr-filter/examples/fir_filter_ccc.py +++ b/gr-filter/examples/fir_filter_ccc.py @@ -106,7 +106,7 @@ def main(): s2.plot(data_snk.real, 'g') pylab.show() - + if __name__ == "__main__": try: main() diff --git a/gr-filter/examples/fir_filter_fff.py b/gr-filter/examples/fir_filter_fff.py index c9c5556da3..60b61054e9 100755 --- a/gr-filter/examples/fir_filter_fff.py +++ b/gr-filter/examples/fir_filter_fff.py @@ -106,7 +106,7 @@ def main(): s2.plot(data_snk.real, 'g') pylab.show() - + if __name__ == "__main__": try: main() diff --git a/gr-filter/examples/gr_filtdes_api.py b/gr-filter/examples/gr_filtdes_api.py index c94a56bbc9..6d7716ce49 100755 --- a/gr-filter/examples/gr_filtdes_api.py +++ b/gr-filter/examples/gr_filtdes_api.py @@ -24,14 +24,14 @@ from gnuradio.filter import filter_design import sys ''' -API Blocking call +API Blocking call returns filter taps for FIR filter design returns b,a for IIR filter design -''' +''' filtobj = filter_design.launch(sys.argv) # Displaying all filter paramters -print "Filter Count:", filtobj.get_filtercount() +print "Filter Count:", filtobj.get_filtercount() print "Filter type:", filtobj.get_restype() print "Filter params", filtobj.get_params() print "Filter Coefficients", filtobj.get_taps() diff --git a/gr-filter/examples/gr_filtdes_callback.py b/gr-filter/examples/gr_filtdes_callback.py index a87d7d3dad..9496253d7a 100755 --- a/gr-filter/examples/gr_filtdes_callback.py +++ b/gr-filter/examples/gr_filtdes_callback.py @@ -32,7 +32,7 @@ except ImportError: Callback example Function called when "design" button is pressed or pole-zero plot is changed -launch function returns gr_filter_design mainwindow +launch function returns gr_filter_design mainwindow object when callback is not None ''' def print_params(filtobj): diff --git a/gr-filter/examples/gr_filtdes_live_upd.py b/gr-filter/examples/gr_filtdes_live_upd.py index 52985119e0..9f974dd81c 100755 --- a/gr-filter/examples/gr_filtdes_live_upd.py +++ b/gr-filter/examples/gr_filtdes_live_upd.py @@ -65,7 +65,7 @@ class my_top_block(gr.top_block): self.qapp = QtGui.QApplication(sys.argv) self.filt_taps = [1,] - + src1 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0) src2 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0) src = blocks.add_cc() diff --git a/gr-filter/grc/filter_block_tree.xml b/gr-filter/grc/filter_block_tree.xml index ea0ffd3694..e1cca2436b 100644 --- a/gr-filter/grc/filter_block_tree.xml +++ b/gr-filter/grc/filter_block_tree.xml @@ -2,19 +2,19 @@ <!-- Copyright 2012 Free Software Foundation, Inc. - + This file is part of GNU Radio - + GNU Radio is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. - + GNU Radio is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with GNU Radio; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, diff --git a/gr-filter/include/gnuradio/filter/dc_blocker_cc.h b/gr-filter/include/gnuradio/filter/dc_blocker_cc.h index f3ae32d23c..a8971e6a9f 100644 --- a/gr-filter/include/gnuradio/filter/dc_blocker_cc.h +++ b/gr-filter/include/gnuradio/filter/dc_blocker_cc.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + /*! * \brief a computationally efficient controllable DC blocker * \ingroup filter_blk diff --git a/gr-filter/include/gnuradio/filter/dc_blocker_ff.h b/gr-filter/include/gnuradio/filter/dc_blocker_ff.h index 3363e95bc3..e01827e468 100644 --- a/gr-filter/include/gnuradio/filter/dc_blocker_ff.h +++ b/gr-filter/include/gnuradio/filter/dc_blocker_ff.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + /*! * \brief a computationally efficient controllable DC blocker * \ingroup filter_blk diff --git a/gr-filter/include/gnuradio/filter/fft_filter_ccc.h b/gr-filter/include/gnuradio/filter/fft_filter_ccc.h index a9ca7ef6d4..2cff4585d2 100644 --- a/gr-filter/include/gnuradio/filter/fft_filter_ccc.h +++ b/gr-filter/include/gnuradio/filter/fft_filter_ccc.h @@ -60,7 +60,7 @@ namespace gr { /*! * Build an FFT filter blocks. - * + * * \param decimation >= 1 * \param taps complex filter taps * \param nthreads number of threads for the FFT to use diff --git a/gr-filter/include/gnuradio/filter/fft_filter_fff.h b/gr-filter/include/gnuradio/filter/fft_filter_fff.h index 10c63dd9ed..dc56077679 100644 --- a/gr-filter/include/gnuradio/filter/fft_filter_fff.h +++ b/gr-filter/include/gnuradio/filter/fft_filter_fff.h @@ -60,7 +60,7 @@ namespace gr { /*! * Build an FFT filter block. - * + * * \param decimation >= 1 * \param taps float filter taps * \param nthreads number of threads for the FFT to use diff --git a/gr-filter/include/gnuradio/filter/filter_delay_fc.h b/gr-filter/include/gnuradio/filter/filter_delay_fc.h index 5b87d4b12d..af33ad203b 100644 --- a/gr-filter/include/gnuradio/filter/filter_delay_fc.h +++ b/gr-filter/include/gnuradio/filter/filter_delay_fc.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + /*! * \brief Filter-Delay Combination Block. * \ingroup filter_blk diff --git a/gr-filter/include/gnuradio/filter/filterbank.h b/gr-filter/include/gnuradio/filter/filterbank.h index f71d6c9fdd..a28917957e 100644 --- a/gr-filter/include/gnuradio/filter/filterbank.h +++ b/gr-filter/include/gnuradio/filter/filterbank.h @@ -30,7 +30,7 @@ namespace gr { namespace filter { namespace kernel { - + /*! * \brief A filter bank with generic taps. * @@ -39,7 +39,7 @@ namespace gr { * outputs. * * The only advantage of using this block over N individual - * FIR filter blocks is that it places less of a load on the + * FIR filter blocks is that it places less of a load on the * scheduler. * * The number of filters cannot be changed dynamically, however @@ -59,7 +59,7 @@ namespace gr { std::vector< std::vector<float> > d_taps; std::vector<bool> d_active; unsigned int d_taps_per_filter; - + public: /*! * Build the filterbank. @@ -68,7 +68,7 @@ namespace gr { * Populates the filters. */ filterbank(const std::vector<std::vector<float> > &taps); - + ~filterbank(); /*! @@ -89,7 +89,7 @@ namespace gr { */ std::vector<std::vector<float> > taps() const; }; - + } /* namespace kernel */ } /* namespace filter */ } /* namespace gr */ diff --git a/gr-filter/include/gnuradio/filter/fir_filter.h b/gr-filter/include/gnuradio/filter/fir_filter.h index 973b55d322..99ca96c19a 100644 --- a/gr-filter/include/gnuradio/filter/fir_filter.h +++ b/gr-filter/include/gnuradio/filter/fir_filter.h @@ -30,7 +30,7 @@ namespace gr { namespace filter { namespace kernel { - + class FILTER_API fir_filter_fff { public: @@ -42,7 +42,7 @@ namespace gr { void update_tap(float t, unsigned int index); std::vector<float> taps() const; unsigned int ntaps() const; - + float filter(const float input[]); void filterN(float output[], const float input[], @@ -62,7 +62,7 @@ namespace gr { }; /**************************************************************/ - + class FILTER_API fir_filter_ccf { public: @@ -94,7 +94,7 @@ namespace gr { }; /**************************************************************/ - + class FILTER_API fir_filter_fcc { public: @@ -126,7 +126,7 @@ namespace gr { }; /**************************************************************/ - + class FILTER_API fir_filter_ccc { public: @@ -158,7 +158,7 @@ namespace gr { }; /**************************************************************/ - + class FILTER_API fir_filter_scc { public: @@ -190,7 +190,7 @@ namespace gr { }; /**************************************************************/ - + class FILTER_API fir_filter_fsf { public: diff --git a/gr-filter/include/gnuradio/filter/fir_filter_with_buffer.h b/gr-filter/include/gnuradio/filter/fir_filter_with_buffer.h index 8520b692c4..387e96c6ac 100644 --- a/gr-filter/include/gnuradio/filter/fir_filter_with_buffer.h +++ b/gr-filter/include/gnuradio/filter/fir_filter_with_buffer.h @@ -49,7 +49,7 @@ namespace gr { int d_naligned; public: - + // CONSTRUCTORS /*! @@ -146,7 +146,7 @@ namespace gr { int d_naligned; public: - + // CONSTRUCTORS /*! @@ -243,7 +243,7 @@ namespace gr { int d_naligned; public: - + // CONSTRUCTORS /*! diff --git a/gr-filter/include/gnuradio/filter/firdes.h b/gr-filter/include/gnuradio/filter/firdes.h index 7e22cbde06..78540bd6aa 100644 --- a/gr-filter/include/gnuradio/filter/firdes.h +++ b/gr-filter/include/gnuradio/filter/firdes.h @@ -36,7 +36,7 @@ namespace gr { * \brief Finite Impulse Response (FIR) filter design functions. * \ingroup filter_design */ - + class FILTER_API firdes { public: @@ -58,7 +58,7 @@ namespace gr { static std::vector<float> window(win_type type, int ntaps, double beta); // ... class methods ... - + /*! * \brief use "window method" to design a low-pass FIR filter * @@ -80,7 +80,7 @@ namespace gr { 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 * @@ -122,7 +122,7 @@ namespace gr { * maximum attenuation and passband ripple. * \p beta: parameter for Kaiser window */ - + static std::vector<float> high_pass(double gain, double sampling_freq, @@ -148,7 +148,7 @@ namespace gr { * maximum attenuation and passband ripple. * \p beta: parameter for Kaiser window */ - + static std::vector<float> high_pass_2(double gain, double sampling_freq, @@ -157,7 +157,7 @@ namespace gr { 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 * @@ -181,7 +181,7 @@ namespace gr { 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 * @@ -200,7 +200,7 @@ namespace gr { * maximum attenuation and passband ripple. * \p beta: parameter for Kaiser window */ - + static std::vector<float> band_pass_2(double gain, double sampling_freq, @@ -210,7 +210,7 @@ namespace gr { 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 * @@ -234,7 +234,7 @@ namespace gr { 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 * @@ -253,7 +253,7 @@ namespace gr { * maximum attenuation and passband ripple. * \p beta: parameter for Kaiser window */ - + static std::vector<gr_complex> complex_band_pass_2(double gain, double sampling_freq, @@ -263,7 +263,7 @@ namespace gr { 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 * @@ -279,7 +279,7 @@ namespace gr { * maximum attenuation and passband ripple. * \p beta: parameter for Kaiser window */ - + static std::vector<float> band_reject(double gain, double sampling_freq, @@ -288,7 +288,7 @@ namespace gr { 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 * @@ -307,7 +307,7 @@ namespace gr { * maximum attenuation and passband ripple. * \p beta: parameter for Kaiser window */ - + static std::vector<float> band_reject_2(double gain, double sampling_freq, @@ -317,7 +317,7 @@ namespace gr { 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 @@ -328,7 +328,7 @@ namespace gr { 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?) * @@ -344,7 +344,7 @@ namespace gr { double symbol_rate, // Symbol rate, NOT bitrate (unless BPSK) double alpha, // Excess Bandwidth Factor int ntaps); - + /*! * \brief design a Gaussian filter * @@ -357,7 +357,7 @@ namespace gr { double spb, double bt, // Bandwidth to bitrate ratio int ntaps); - + private: static double bessi0(double x); static void sanity_check_1f(double sampling_freq, double f1, @@ -366,16 +366,16 @@ namespace gr { double transition_width); static void sanity_check_2f_c(double sampling_freq, double f1, double f2, double transition_width); - + static int compute_ntaps(double sampling_freq, double transition_width, win_type window_type, double beta); - + static int compute_ntaps_windes(double sampling_freq, double transition_width, double attenuation_dB); }; - + } /* namespace filter */ } /* namespace gr */ diff --git a/gr-filter/include/gnuradio/filter/fractional_interpolator_cc.h b/gr-filter/include/gnuradio/filter/fractional_interpolator_cc.h index ed84d956ef..6cd6413a57 100644 --- a/gr-filter/include/gnuradio/filter/fractional_interpolator_cc.h +++ b/gr-filter/include/gnuradio/filter/fractional_interpolator_cc.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + /*! * \brief Interpolating MMSE filter with complex input, complex output * \ingroup resamplers_blk diff --git a/gr-filter/include/gnuradio/filter/fractional_interpolator_ff.h b/gr-filter/include/gnuradio/filter/fractional_interpolator_ff.h index 04ee235688..c8218adb77 100644 --- a/gr-filter/include/gnuradio/filter/fractional_interpolator_ff.h +++ b/gr-filter/include/gnuradio/filter/fractional_interpolator_ff.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + /*! * \brief Interpolating MMSE filter with float input, float output * \ingroup resamplers_blk diff --git a/gr-filter/include/gnuradio/filter/fractional_resampler_cc.h b/gr-filter/include/gnuradio/filter/fractional_resampler_cc.h index d46a462d35..6fde6dde8a 100644 --- a/gr-filter/include/gnuradio/filter/fractional_resampler_cc.h +++ b/gr-filter/include/gnuradio/filter/fractional_resampler_cc.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + /*! * \brief resampling MMSE filter with complex input, complex output * \ingroup resamplers_blk diff --git a/gr-filter/include/gnuradio/filter/fractional_resampler_ff.h b/gr-filter/include/gnuradio/filter/fractional_resampler_ff.h index e505920f8b..9836010af5 100644 --- a/gr-filter/include/gnuradio/filter/fractional_resampler_ff.h +++ b/gr-filter/include/gnuradio/filter/fractional_resampler_ff.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + /*! * \brief Resampling MMSE filter with float input, float output * \ingroup resamplers_blk diff --git a/gr-filter/include/gnuradio/filter/hilbert_fc.h b/gr-filter/include/gnuradio/filter/hilbert_fc.h index 3999e1a619..7af39731a2 100644 --- a/gr-filter/include/gnuradio/filter/hilbert_fc.h +++ b/gr-filter/include/gnuradio/filter/hilbert_fc.h @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + /*! * \brief Hilbert transformer. * \ingroup filter_blk diff --git a/gr-filter/include/gnuradio/filter/iir_filter.h b/gr-filter/include/gnuradio/filter/iir_filter.h index 58694ff5c4..bf87ce1d85 100644 --- a/gr-filter/include/gnuradio/filter/iir_filter.h +++ b/gr-filter/include/gnuradio/filter/iir_filter.h @@ -120,7 +120,7 @@ namespace gr { d_fbtaps[i] = -fbtaps[i]; } } - + int n = fftaps.size(); int m = fbtaps.size(); d_prev_input.clear(); diff --git a/gr-filter/include/gnuradio/filter/iir_filter_ccc.h b/gr-filter/include/gnuradio/filter/iir_filter_ccc.h index 7ca9108380..2c81942809 100644 --- a/gr-filter/include/gnuradio/filter/iir_filter_ccc.h +++ b/gr-filter/include/gnuradio/filter/iir_filter_ccc.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + /*! * \brief IIR filter with complex input, complex output, and * complex taps. diff --git a/gr-filter/include/gnuradio/filter/iir_filter_ccd.h b/gr-filter/include/gnuradio/filter/iir_filter_ccd.h index c9565f6fec..3c7144940d 100644 --- a/gr-filter/include/gnuradio/filter/iir_filter_ccd.h +++ b/gr-filter/include/gnuradio/filter/iir_filter_ccd.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + /*! * \brief IIR filter with complex input, complex output, and * double taps. diff --git a/gr-filter/include/gnuradio/filter/iir_filter_ccf.h b/gr-filter/include/gnuradio/filter/iir_filter_ccf.h index 2a9a953719..729d915b2c 100644 --- a/gr-filter/include/gnuradio/filter/iir_filter_ccf.h +++ b/gr-filter/include/gnuradio/filter/iir_filter_ccf.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + /*! * \brief IIR filter with complex input, complex output, and * float taps. diff --git a/gr-filter/include/gnuradio/filter/iir_filter_ccz.h b/gr-filter/include/gnuradio/filter/iir_filter_ccz.h index 061ab39715..47cfb4cb21 100644 --- a/gr-filter/include/gnuradio/filter/iir_filter_ccz.h +++ b/gr-filter/include/gnuradio/filter/iir_filter_ccz.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + /*! * \brief IIR filter with complex input, complex output, and * complex (double) taps. diff --git a/gr-filter/include/gnuradio/filter/iir_filter_ffd.h b/gr-filter/include/gnuradio/filter/iir_filter_ffd.h index db61cb149d..ab14718d98 100644 --- a/gr-filter/include/gnuradio/filter/iir_filter_ffd.h +++ b/gr-filter/include/gnuradio/filter/iir_filter_ffd.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + /*! * \brief IIR filter with float input, float output and double taps * \ingroup filter_blk diff --git a/gr-filter/include/gnuradio/filter/mmse_fir_interpolator_cc.h b/gr-filter/include/gnuradio/filter/mmse_fir_interpolator_cc.h index f24e7d9c54..84d91d52d4 100644 --- a/gr-filter/include/gnuradio/filter/mmse_fir_interpolator_cc.h +++ b/gr-filter/include/gnuradio/filter/mmse_fir_interpolator_cc.h @@ -29,7 +29,7 @@ namespace gr { namespace filter { - + /*! * \brief Compute intermediate samples between signal samples x(k*Ts) * \ingroup filter_primitive diff --git a/gr-filter/include/gnuradio/filter/mmse_fir_interpolator_ff.h b/gr-filter/include/gnuradio/filter/mmse_fir_interpolator_ff.h index 069a9fc09c..a69315b3d9 100644 --- a/gr-filter/include/gnuradio/filter/mmse_fir_interpolator_ff.h +++ b/gr-filter/include/gnuradio/filter/mmse_fir_interpolator_ff.h @@ -29,7 +29,7 @@ namespace gr { namespace filter { - + /*! * \brief Compute intermediate samples between signal samples x(k*Ts) * \ingroup filter_primitive diff --git a/gr-filter/include/gnuradio/filter/pfb_arb_resampler_ccf.h b/gr-filter/include/gnuradio/filter/pfb_arb_resampler_ccf.h index 1c5dd49628..453d0cdb5f 100644 --- a/gr-filter/include/gnuradio/filter/pfb_arb_resampler_ccf.h +++ b/gr-filter/include/gnuradio/filter/pfb_arb_resampler_ccf.h @@ -38,7 +38,7 @@ namespace gr { * \details * This block takes in a signal stream and calls - * gr::filter::kernel::pfb_arb_resampler_ccf to perform + * gr::filter::kernel::pfb_arb_resampler_ccf to perform * arbitrary resampling on the stream. * * Output sampling rate is \p rate * input rate. @@ -105,12 +105,12 @@ namespace gr { /*! * Gets the decimation rate of the filter. - */ + */ virtual unsigned int decimation_rate() const =0; - + /*! * Gets the fractional rate of the filter. - */ + */ virtual float fractional_rate() const = 0; /*! diff --git a/gr-filter/include/gnuradio/filter/pfb_arb_resampler_fff.h b/gr-filter/include/gnuradio/filter/pfb_arb_resampler_fff.h index 70016bc656..7ae3dcb38f 100644 --- a/gr-filter/include/gnuradio/filter/pfb_arb_resampler_fff.h +++ b/gr-filter/include/gnuradio/filter/pfb_arb_resampler_fff.h @@ -154,12 +154,12 @@ namespace gr { /*! * Gets the decimation rate of the filter. - */ + */ virtual unsigned int decimation_rate() const =0; - + /*! * Gets the fractional rate of the filter. - */ + */ virtual float fractional_rate() const = 0; /*! diff --git a/gr-filter/include/gnuradio/filter/pm_remez.h b/gr-filter/include/gnuradio/filter/pm_remez.h index 00899eaf45..98683cd637 100644 --- a/gr-filter/include/gnuradio/filter/pm_remez.h +++ b/gr-filter/include/gnuradio/filter/pm_remez.h @@ -65,7 +65,7 @@ namespace gr { const std::string filter_type = "bandpass", int grid_density = 16 ) throw (std::runtime_error); - + } /* namespace filter */ } /* namespace gr */ diff --git a/gr-filter/include/gnuradio/filter/single_pole_iir.h b/gr-filter/include/gnuradio/filter/single_pole_iir.h index 0ded3a4ede..bb21bccf79 100644 --- a/gr-filter/include/gnuradio/filter/single_pole_iir.h +++ b/gr-filter/include/gnuradio/filter/single_pole_iir.h @@ -29,7 +29,7 @@ namespace gr { namespace filter { - + /*! * \brief class template for single pole IIR filter */ diff --git a/gr-filter/include/gnuradio/filter/single_pole_iir_filter_cc.h b/gr-filter/include/gnuradio/filter/single_pole_iir_filter_cc.h index e84270aa63..fcba7b655e 100644 --- a/gr-filter/include/gnuradio/filter/single_pole_iir_filter_cc.h +++ b/gr-filter/include/gnuradio/filter/single_pole_iir_filter_cc.h @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + /*! * \brief single pole IIR filter with complex input, complex output * \ingroup filter_blk @@ -57,7 +57,7 @@ namespace gr { \xmlonly H(z) = \ frac{alpha}{1 - (1-alpha) z^{-1}} \endxmlonly - + * Note that some texts define the system function with a + in the * denominator. If you're using that convention, you'll need to * negate the feedback tap. diff --git a/gr-filter/include/gnuradio/filter/single_pole_iir_filter_ff.h b/gr-filter/include/gnuradio/filter/single_pole_iir_filter_ff.h index ae9e1821cb..4996513fa9 100644 --- a/gr-filter/include/gnuradio/filter/single_pole_iir_filter_ff.h +++ b/gr-filter/include/gnuradio/filter/single_pole_iir_filter_ff.h @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + /*! * \brief single pole IIR filter with float input, float output * \ingroup filter_blk @@ -69,7 +69,7 @@ namespace gr { typedef boost::shared_ptr<single_pole_iir_filter_ff> sptr; static sptr make(double alpha, unsigned int vlen=1); - + virtual void set_taps (double alpha) = 0; }; diff --git a/gr-filter/lib/dc_blocker_cc_impl.cc b/gr-filter/lib/dc_blocker_cc_impl.cc index 355426e821..c05a721c99 100644 --- a/gr-filter/lib/dc_blocker_cc_impl.cc +++ b/gr-filter/lib/dc_blocker_cc_impl.cc @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + moving_averager_c::moving_averager_c(int D) : d_length(D), d_out(0), d_out_d1(0), d_out_d2(0) { @@ -48,10 +48,10 @@ namespace gr { d_delay_line.push_back(x); d_out = d_delay_line[0]; d_delay_line.pop_front(); - + gr_complex y = x - d_out_d1 + d_out_d2; d_out_d2 = y; - + return (y / (float)(d_length)); } @@ -114,7 +114,7 @@ namespace gr { { const gr_complex *in = (const gr_complex*)input_items[0]; gr_complex *out = (gr_complex*)output_items[0]; - + if(d_long_form) { gr_complex y1, y2, y3, y4, d; for(int i = 0; i < noutput_items; i++) { @@ -122,11 +122,11 @@ namespace gr { y2 = d_ma_1->filter(y1); y3 = d_ma_2->filter(y2); y4 = d_ma_3->filter(y3); - + d_delay_line.push_back(d_ma_0->delayed_sig()); d = d_delay_line[0]; d_delay_line.pop_front(); - + out[i] = d - y4; } } @@ -138,7 +138,7 @@ namespace gr { out[i] = d_ma_0->delayed_sig() - y2; } } - + return noutput_items; } diff --git a/gr-filter/lib/dc_blocker_cc_impl.h b/gr-filter/lib/dc_blocker_cc_impl.h index a5093cb505..9abf140a81 100644 --- a/gr-filter/lib/dc_blocker_cc_impl.h +++ b/gr-filter/lib/dc_blocker_cc_impl.h @@ -29,22 +29,22 @@ namespace gr { namespace filter { - + class moving_averager_c { public: moving_averager_c(int D); ~moving_averager_c(); - + gr_complex filter(gr_complex x); gr_complex delayed_sig() { return d_out; } - + private: int d_length; gr_complex d_out, d_out_d1, d_out_d2; std::deque<gr_complex> d_delay_line; }; - + class FILTER_API dc_blocker_cc_impl : public dc_blocker_cc { private: @@ -62,9 +62,9 @@ namespace gr { ~dc_blocker_cc_impl(); int group_delay(); - + //int set_length(int D); - + int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/gr-filter/lib/dc_blocker_ff_impl.cc b/gr-filter/lib/dc_blocker_ff_impl.cc index c0b5b17022..b5188c8e88 100644 --- a/gr-filter/lib/dc_blocker_ff_impl.cc +++ b/gr-filter/lib/dc_blocker_ff_impl.cc @@ -30,13 +30,13 @@ namespace gr { namespace filter { - + moving_averager_f::moving_averager_f(int D) : d_length(D), d_out(0), d_out_d1(0), d_out_d2(0) { d_delay_line = std::deque<float>(d_length-1, 0); } - + moving_averager_f::~moving_averager_f() { } @@ -48,13 +48,13 @@ namespace gr { d_delay_line.push_back(x); d_out = d_delay_line[0]; d_delay_line.pop_front(); - + float y = x - d_out_d1 + d_out_d2; d_out_d2 = y; - + return (y / (float)(d_length)); } - + dc_blocker_ff::sptr dc_blocker_ff::make(int D, bool long_form) { diff --git a/gr-filter/lib/dc_blocker_ff_impl.h b/gr-filter/lib/dc_blocker_ff_impl.h index c00b750a5d..f9c78882df 100644 --- a/gr-filter/lib/dc_blocker_ff_impl.h +++ b/gr-filter/lib/dc_blocker_ff_impl.h @@ -29,22 +29,22 @@ namespace gr { namespace filter { - + class moving_averager_f { public: moving_averager_f(int D); ~moving_averager_f(); - + float filter(float x); float delayed_sig() { return d_out; } - + private: int d_length; float d_out, d_out_d1, d_out_d2; std::deque<float> d_delay_line; }; - + class FILTER_API dc_blocker_ff_impl : public dc_blocker_ff { private: @@ -62,9 +62,9 @@ namespace gr { ~dc_blocker_ff_impl(); int group_delay(); - + //int set_length(int D); - + int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/gr-filter/lib/fft_filter_ccc_impl.cc b/gr-filter/lib/fft_filter_ccc_impl.cc index 09077d2116..34c9f59880 100644 --- a/gr-filter/lib/fft_filter_ccc_impl.cc +++ b/gr-filter/lib/fft_filter_ccc_impl.cc @@ -33,7 +33,7 @@ namespace gr { namespace filter { - + fft_filter_ccc::sptr fft_filter_ccc::make(int decimation, const std::vector<gr_complex> &taps, int nthreads) @@ -52,7 +52,7 @@ namespace gr { d_updated(false) { set_history(1); - + d_filter = new kernel::fft_filter_ccc(decimation, taps, nthreads); d_new_taps = taps; @@ -84,7 +84,7 @@ namespace gr { if(d_filter) d_filter->set_nthreads(n); } - + int fft_filter_ccc_impl::nthreads() const { @@ -101,18 +101,18 @@ namespace gr { { const gr_complex *in = (const gr_complex *) input_items[0]; gr_complex *out = (gr_complex *) output_items[0]; - + if (d_updated){ d_nsamples = d_filter->set_taps(d_new_taps); d_updated = false; set_output_multiple(d_nsamples); return 0; // output multiple may have changed } - + d_filter->filter(noutput_items, in, out); return noutput_items; } - + } /* namespace filter */ } /* namespace gr */ diff --git a/gr-filter/lib/fft_filter_ccc_impl.h b/gr-filter/lib/fft_filter_ccc_impl.h index 2f804f7bb3..c7a07a92a8 100644 --- a/gr-filter/lib/fft_filter_ccc_impl.h +++ b/gr-filter/lib/fft_filter_ccc_impl.h @@ -41,7 +41,7 @@ namespace gr { fft_filter_ccc_impl(int decimation, const std::vector<gr_complex> &taps, int nthreads=1); - + ~fft_filter_ccc_impl(); void set_taps(const std::vector<gr_complex> &taps); @@ -49,7 +49,7 @@ namespace gr { void set_nthreads(int n); int nthreads() const; - + int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/gr-filter/lib/fft_filter_fff_impl.cc b/gr-filter/lib/fft_filter_fff_impl.cc index 9d6fa4a59a..de10c4616d 100644 --- a/gr-filter/lib/fft_filter_fff_impl.cc +++ b/gr-filter/lib/fft_filter_fff_impl.cc @@ -33,7 +33,7 @@ namespace gr { namespace filter { - + fft_filter_fff::sptr fft_filter_fff::make(int decimation, const std::vector<float> &taps, int nthreads) @@ -41,8 +41,8 @@ namespace gr { return gnuradio::get_initial_sptr(new fft_filter_fff_impl (decimation, taps, nthreads)); } - - + + fft_filter_fff_impl::fft_filter_fff_impl(int decimation, const std::vector<float> &taps, int nthreads) @@ -53,7 +53,7 @@ namespace gr { d_updated(false) { set_history(1); - + d_filter = new kernel::fft_filter_fff(decimation, taps, nthreads); d_new_taps = taps; @@ -65,27 +65,27 @@ namespace gr { { delete d_filter; } - + void fft_filter_fff_impl::set_taps(const std::vector<float> &taps) { d_new_taps = taps; d_updated = true; } - + std::vector<float> fft_filter_fff_impl::taps() const { return d_new_taps; } - + void fft_filter_fff_impl::set_nthreads(int n) { if(d_filter) d_filter->set_nthreads(n); } - + int fft_filter_fff_impl::nthreads() const { @@ -102,18 +102,18 @@ namespace gr { { const float *in = (const float *)input_items[0]; float *out = (float *)output_items[0]; - + if (d_updated){ d_nsamples = d_filter->set_taps(d_new_taps); d_updated = false; set_output_multiple(d_nsamples); return 0; // output multiple may have changed } - + d_filter->filter(noutput_items, in, out); - + return noutput_items; } - + } /* namespace filter */ } /* namespace gr */ diff --git a/gr-filter/lib/fft_filter_fff_impl.h b/gr-filter/lib/fft_filter_fff_impl.h index 85b75ef625..8c4e134110 100644 --- a/gr-filter/lib/fft_filter_fff_impl.h +++ b/gr-filter/lib/fft_filter_fff_impl.h @@ -49,7 +49,7 @@ namespace gr { void set_nthreads(int n); int nthreads() const; - + int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/gr-filter/lib/filter_delay_fc_impl.cc b/gr-filter/lib/filter_delay_fc_impl.cc index 645cfdc67e..1a4d47582b 100644 --- a/gr-filter/lib/filter_delay_fc_impl.cc +++ b/gr-filter/lib/filter_delay_fc_impl.cc @@ -29,7 +29,7 @@ namespace gr { namespace filter { - + filter_delay_fc::sptr filter_delay_fc::make(const std::vector<float> &taps) { return gnuradio::get_initial_sptr(new filter_delay_fc_impl(taps)); @@ -93,14 +93,14 @@ namespace gr { d_fir->filter(&in0[i])); } break; - + case 2: for(int j = 0; j < noutput_items; j++) { out[j] = gr_complex(in0[j + d_delay], d_fir->filter(&in1[j])); } break; - + default: assert(0); } diff --git a/gr-filter/lib/filter_delay_fc_impl.h b/gr-filter/lib/filter_delay_fc_impl.h index 5f39de223a..ef4b33132e 100644 --- a/gr-filter/lib/filter_delay_fc_impl.h +++ b/gr-filter/lib/filter_delay_fc_impl.h @@ -29,7 +29,7 @@ namespace gr { namespace filter { - + class FILTER_API filter_delay_fc_impl : public filter_delay_fc { private: @@ -44,7 +44,7 @@ namespace gr { std::vector<float> taps(); void set_taps(const std::vector<float> &taps); - + int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/gr-filter/lib/fir_filter.cc b/gr-filter/lib/fir_filter.cc index e322cfb129..3ea3c8b8f6 100644 --- a/gr-filter/lib/fir_filter.cc +++ b/gr-filter/lib/fir_filter.cc @@ -29,7 +29,7 @@ namespace gr { namespace filter { namespace kernel { - + fir_filter_fff::fir_filter_fff(int decimation, const std::vector<float> &taps) { @@ -42,7 +42,7 @@ namespace gr { // Make sure the output sample is always aligned, too. d_output = (float*)volk_malloc(1*sizeof(float), d_align); } - + fir_filter_fff::~fir_filter_fff() { // Free all aligned taps @@ -57,7 +57,7 @@ namespace gr { // Free output sample volk_free(d_output); } - + void fir_filter_fff::set_taps(const std::vector<float> &taps) { @@ -69,7 +69,7 @@ namespace gr { ::free(d_aligned_taps); d_aligned_taps = NULL; } - + d_ntaps = (int)taps.size(); d_taps = taps; std::reverse(d_taps.begin(), d_taps.end()); @@ -118,7 +118,7 @@ namespace gr { d_ntaps+al); return *d_output; } - + void fir_filter_fff::filterN(float output[], const float input[], @@ -128,7 +128,7 @@ namespace gr { output[i] = filter(&input[i]); } } - + void fir_filter_fff::filterNdec(float output[], const float input[], @@ -141,7 +141,7 @@ namespace gr { j += decimate; } } - + /**************************************************************/ fir_filter_ccf::fir_filter_ccf(int decimation, @@ -156,7 +156,7 @@ namespace gr { // Make sure the output sample is always aligned, too. d_output = (gr_complex*)volk_malloc(1*sizeof(gr_complex), d_align); } - + fir_filter_ccf::~fir_filter_ccf() { // Free all aligned taps @@ -171,7 +171,7 @@ namespace gr { // Free output sample volk_free(d_output); } - + void fir_filter_ccf::set_taps(const std::vector<float> &taps) { @@ -183,7 +183,7 @@ namespace gr { ::free(d_aligned_taps); d_aligned_taps = NULL; } - + d_ntaps = (int)taps.size(); d_taps = taps; std::reverse(d_taps.begin(), d_taps.end()); @@ -197,7 +197,7 @@ namespace gr { d_aligned_taps[i][i+j] = d_taps[j]; } } - + void fir_filter_ccf::update_tap(float t, unsigned int index) { @@ -220,7 +220,7 @@ namespace gr { { return d_ntaps; } - + gr_complex fir_filter_ccf::filter(const gr_complex input[]) { @@ -232,7 +232,7 @@ namespace gr { (d_ntaps+al)); return *d_output; } - + void fir_filter_ccf::filterN(gr_complex output[], const gr_complex input[], @@ -241,8 +241,8 @@ namespace gr { for(unsigned long i = 0; i < n; i++) output[i] = filter(&input[i]); } - - + + void fir_filter_ccf::filterNdec(gr_complex output[], const gr_complex input[], @@ -255,7 +255,7 @@ namespace gr { j += decimate; } } - + /**************************************************************/ @@ -272,7 +272,7 @@ namespace gr { // Make sure the output sample is always aligned, too. d_output = (gr_complex*)volk_malloc(1*sizeof(gr_complex), d_align); } - + fir_filter_fcc::~fir_filter_fcc() { // Free all aligned taps @@ -287,7 +287,7 @@ namespace gr { // Free output sample volk_free(d_output); } - + void fir_filter_fcc::set_taps(const std::vector<gr_complex> &taps) { @@ -299,7 +299,7 @@ namespace gr { ::free(d_aligned_taps); d_aligned_taps = NULL; } - + d_ntaps = (int)taps.size(); d_taps = taps; std::reverse(d_taps.begin(), d_taps.end()); @@ -313,7 +313,7 @@ namespace gr { d_aligned_taps[i][i+j] = d_taps[j]; } } - + void fir_filter_fcc::update_tap(gr_complex t, unsigned int index) { @@ -337,7 +337,7 @@ namespace gr { { return d_ntaps; } - + gr_complex fir_filter_fcc::filter(const float input[]) { @@ -350,7 +350,7 @@ namespace gr { (d_ntaps+al)); return *d_output; } - + void fir_filter_fcc::filterN(gr_complex output[], const float input[], @@ -359,8 +359,8 @@ namespace gr { for(unsigned long i = 0; i < n; i++) output[i] = filter(&input[i]); } - - + + void fir_filter_fcc::filterNdec(gr_complex output[], const float input[], @@ -373,7 +373,7 @@ namespace gr { j += decimate; } } - + /**************************************************************/ fir_filter_ccc::fir_filter_ccc(int decimation, @@ -388,7 +388,7 @@ namespace gr { // Make sure the output sample is always aligned, too. d_output = (gr_complex*)volk_malloc(1*sizeof(gr_complex), d_align); } - + fir_filter_ccc::~fir_filter_ccc() { // Free all aligned taps @@ -403,7 +403,7 @@ namespace gr { // Free output sample volk_free(d_output); } - + void fir_filter_ccc::set_taps(const std::vector<gr_complex> &taps) { @@ -415,7 +415,7 @@ namespace gr { ::free(d_aligned_taps); d_aligned_taps = NULL; } - + d_ntaps = (int)taps.size(); d_taps = taps; std::reverse(d_taps.begin(), d_taps.end()); @@ -429,7 +429,7 @@ namespace gr { d_aligned_taps[i][i+j] = d_taps[j]; } } - + void fir_filter_ccc::update_tap(gr_complex t, unsigned int index) { @@ -452,7 +452,7 @@ namespace gr { { return d_ntaps; } - + gr_complex fir_filter_ccc::filter(const gr_complex input[]) { @@ -464,7 +464,7 @@ namespace gr { (d_ntaps+al)); return *d_output; } - + void fir_filter_ccc::filterN(gr_complex output[], const gr_complex input[], @@ -473,8 +473,8 @@ namespace gr { for(unsigned long i = 0; i < n; i++) output[i] = filter(&input[i]); } - - + + void fir_filter_ccc::filterNdec(gr_complex output[], const gr_complex input[], @@ -487,7 +487,7 @@ namespace gr { j += decimate; } } - + /**************************************************************/ fir_filter_scc::fir_filter_scc(int decimation, @@ -502,7 +502,7 @@ namespace gr { // Make sure the output sample is always aligned, too. d_output = (gr_complex*)volk_malloc(1*sizeof(gr_complex), d_align); } - + fir_filter_scc::~fir_filter_scc() { // Free all aligned taps @@ -517,7 +517,7 @@ namespace gr { // Free output sample volk_free(d_output); } - + void fir_filter_scc::set_taps(const std::vector<gr_complex> &taps) { @@ -529,7 +529,7 @@ namespace gr { ::free(d_aligned_taps); d_aligned_taps = NULL; } - + d_ntaps = (int)taps.size(); d_taps = taps; std::reverse(d_taps.begin(), d_taps.end()); @@ -543,7 +543,7 @@ namespace gr { d_aligned_taps[i][i+j] = d_taps[j]; } } - + void fir_filter_scc::update_tap(gr_complex t, unsigned int index) { @@ -566,7 +566,7 @@ namespace gr { { return d_ntaps; } - + gr_complex fir_filter_scc::filter(const short input[]) { @@ -579,7 +579,7 @@ namespace gr { return *d_output; } - + void fir_filter_scc::filterN(gr_complex output[], const short input[], @@ -588,8 +588,8 @@ namespace gr { for(unsigned long i = 0; i < n; i++) output[i] = filter(&input[i]); } - - + + void fir_filter_scc::filterNdec(gr_complex output[], const short input[], @@ -617,7 +617,7 @@ namespace gr { // Make sure the output sample is always aligned, too. d_output = (short*)volk_malloc(1*sizeof(short), d_align); } - + fir_filter_fsf::~fir_filter_fsf() { // Free all aligned taps @@ -632,7 +632,7 @@ namespace gr { // Free output sample volk_free(d_output); } - + void fir_filter_fsf::set_taps(const std::vector<float> &taps) { @@ -644,7 +644,7 @@ namespace gr { ::free(d_aligned_taps); d_aligned_taps = NULL; } - + d_ntaps = (int)taps.size(); d_taps = taps; std::reverse(d_taps.begin(), d_taps.end()); @@ -658,7 +658,7 @@ namespace gr { d_aligned_taps[i][i+j] = d_taps[j]; } } - + void fir_filter_fsf::update_tap(float t, unsigned int index) { @@ -681,7 +681,7 @@ namespace gr { { return d_ntaps; } - + short fir_filter_fsf::filter(const float input[]) { @@ -694,7 +694,7 @@ namespace gr { return *d_output; } - + void fir_filter_fsf::filterN(short output[], const float input[], diff --git a/gr-filter/lib/fir_filter_XXX_impl.cc.t b/gr-filter/lib/fir_filter_XXX_impl.cc.t index 8b8938095f..4a112a2180 100644 --- a/gr-filter/lib/fir_filter_XXX_impl.cc.t +++ b/gr-filter/lib/fir_filter_XXX_impl.cc.t @@ -32,7 +32,7 @@ namespace gr { namespace filter { - + @BASE_NAME@::sptr @BASE_NAME@::make(int decimation, const std::vector<@TAP_TYPE@> &taps) { @@ -68,7 +68,7 @@ namespace gr { d_fir->set_taps(taps); d_updated = true; } - + std::vector<@TAP_TYPE@> @IMPL_NAME@::taps() const { @@ -84,13 +84,13 @@ namespace gr { const @I_TYPE@ *in = (const @I_TYPE@*)input_items[0]; @O_TYPE@ *out = (@O_TYPE@*)output_items[0]; - + if (d_updated) { set_history(d_fir->ntaps()); d_updated = false; return 0; // history requirements may have changed. } - + if (decimation() == 1) { d_fir->filterN(out, in, noutput_items); } @@ -98,7 +98,7 @@ namespace gr { d_fir->filterNdec(out, in, noutput_items, decimation()); } - + return noutput_items; } diff --git a/gr-filter/lib/fir_filter_XXX_impl.h.t b/gr-filter/lib/fir_filter_XXX_impl.h.t index d00e73dc33..3678d82acb 100644 --- a/gr-filter/lib/fir_filter_XXX_impl.h.t +++ b/gr-filter/lib/fir_filter_XXX_impl.h.t @@ -44,7 +44,7 @@ namespace gr { void set_taps(const std::vector<@TAP_TYPE@> &taps); std::vector<@TAP_TYPE@> taps() const; - + int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/gr-filter/lib/fir_filter_with_buffer.cc b/gr-filter/lib/fir_filter_with_buffer.cc index 4191dc3932..9d4dd3a023 100644 --- a/gr-filter/lib/fir_filter_with_buffer.cc +++ b/gr-filter/lib/fir_filter_with_buffer.cc @@ -54,7 +54,7 @@ namespace gr { volk_free(d_buffer_ptr); d_buffer_ptr = NULL; } - + // Free aligned taps if(d_aligned_taps != NULL) { for(int i = 0; i < d_naligned; i++) { @@ -185,7 +185,7 @@ namespace gr { } } - + /**************************************************************/ @@ -208,7 +208,7 @@ namespace gr { volk_free(d_buffer_ptr); d_buffer_ptr = NULL; } - + // Free aligned taps if(d_aligned_taps != NULL) { for(int i = 0; i < d_naligned; i++) { @@ -338,7 +338,7 @@ namespace gr { } } - + /**************************************************************/ @@ -361,7 +361,7 @@ namespace gr { volk_free(d_buffer_ptr); d_buffer_ptr = NULL; } - + // Free aligned taps if(d_aligned_taps != NULL) { for(int i = 0; i < d_naligned; i++) { diff --git a/gr-filter/lib/firdes.cc b/gr-filter/lib/firdes.cc index 1726d0bed8..351eb7a71d 100644 --- a/gr-filter/lib/firdes.cc +++ b/gr-filter/lib/firdes.cc @@ -37,11 +37,11 @@ namespace gr { { return fft::window::build(static_cast<fft::window::win_type>(type), ntaps, beta); } - + // // === Low Pass === // - + vector<float> firdes::low_pass_2(double gain, double sampling_freq, // Hz @@ -52,11 +52,11 @@ namespace gr { double beta) // used only with Kaiser { sanity_check_1f(sampling_freq, cutoff_freq, transition_width); - + int ntaps = compute_ntaps_windes(sampling_freq, transition_width, attenuation_dB); - + // construct the truncated ideal impulse response // [sin(x)/x for the low pass case] @@ -105,7 +105,7 @@ namespace gr { // 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); @@ -123,7 +123,7 @@ namespace gr { // find the factor to normalize the gain, fmax. // For low-pass, gain @ zero freq = 1.0 - + double fmax = taps[0 + M]; for(int n = 1; n <= M; n++) fmax += 2 * taps[n + M]; @@ -140,7 +140,7 @@ namespace gr { // // === High Pass === // - + vector<float> firdes::high_pass_2(double gain, double sampling_freq, @@ -151,13 +151,13 @@ namespace gr { double beta) // used only with Kaiser { sanity_check_1f(sampling_freq, cutoff_freq, transition_width); - + int ntaps = compute_ntaps_windes(sampling_freq, transition_width, attenuation_dB); // construct the truncated ideal impulse response times the window function - + vector<float> taps(ntaps); vector<float> w = window(window_type, ntaps, beta); @@ -175,13 +175,13 @@ namespace gr { // find the factor to normalize the gain, fmax. // For high-pass, gain @ fs/2 freq = 1.0 - + double fmax = taps[0 + M]; for(int n = 1; n <= M; n++) fmax += 2 * taps[n + M] * cos(n * M_PI); - + gain /= fmax; // normalize - + for(int i = 0; i < ntaps; i++) taps[i] *= gain; @@ -202,7 +202,7 @@ namespace gr { int ntaps = compute_ntaps(sampling_freq, transition_width, window_type, beta); - + // construct the truncated ideal impulse response times the window function vector<float> taps(ntaps); @@ -222,7 +222,7 @@ namespace gr { // find the factor to normalize the gain, fmax. // For high-pass, gain @ fs/2 freq = 1.0 - + double fmax = taps[0 + M]; for(int n = 1; n <= M; n++) fmax += 2 * taps[n + M] * cos(n * M_PI); @@ -274,7 +274,7 @@ namespace gr { // find the factor to normalize the gain, fmax. // For band-pass, gain @ center freq = 1.0 - + double fmax = taps[0 + M]; for(int n = 1; n <= M; n++) fmax += 2 * taps[n + M] * cos(n * (fwT0 + fwT1) * 0.5); @@ -314,7 +314,7 @@ namespace gr { int M = (ntaps - 1) / 2; double fwT0 = 2 * M_PI * low_cutoff_freq / sampling_freq; double fwT1 = 2 * M_PI * high_cutoff_freq / sampling_freq; - + for(int n = -M; n <= M; n++) { if (n == 0) taps[n + M] = (fwT1 - fwT0) / M_PI * w[n + M]; @@ -376,8 +376,8 @@ namespace gr { float phase = 0; if (lptaps.size() & 01) { phase = - freq * ( lptaps.size() >> 1 ); - } - else + } + else phase = - freq/2.0 * ((1 + 2*lptaps.size()) >> 1); for(unsigned int i = 0; i < lptaps.size(); i++) { @@ -423,7 +423,7 @@ namespace gr { float phase = 0; if(lptaps.size() & 01) { phase = - freq * ( lptaps.size() >> 1 ); - } + } else phase = - freq/2.0 * ((1 + 2*lptaps.size()) >> 1); @@ -572,7 +572,7 @@ namespace gr { taps[i] /= gain; return taps; } - + // // Gaussian // @@ -647,7 +647,7 @@ namespace gr { taps[i] = 4 * alpha * num / den; scale += taps[i]; } - + for(int i = 0; i < ntaps; i++) taps[i] = taps[i] * gain / scale; @@ -734,13 +734,13 @@ namespace gr { if (fa <= 0.0 || fa > sampling_freq / 2) throw std::out_of_range("firdes check failed: 0 < fa <= sampling_freq / 2"); - + if (fb <= 0.0 || fb > sampling_freq / 2) throw std::out_of_range("firdes check failed: 0 < fb <= sampling_freq / 2"); - + if (fa > fb) throw std::out_of_range("firdes check failed: fa <= fb"); - + if (transition_width <= 0) throw std::out_of_range("firdes check failed: transition_width > 0"); } diff --git a/gr-filter/lib/fractional_interpolator_cc_impl.cc b/gr-filter/lib/fractional_interpolator_cc_impl.cc index 06e823f75a..938c377cc8 100644 --- a/gr-filter/lib/fractional_interpolator_cc_impl.cc +++ b/gr-filter/lib/fractional_interpolator_cc_impl.cc @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + fractional_interpolator_cc::sptr fractional_interpolator_cc::make(float phase_shift, float interp_ratio) { diff --git a/gr-filter/lib/fractional_interpolator_cc_impl.h b/gr-filter/lib/fractional_interpolator_cc_impl.h index 6297313b97..786bccfbaf 100644 --- a/gr-filter/lib/fractional_interpolator_cc_impl.h +++ b/gr-filter/lib/fractional_interpolator_cc_impl.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + class FILTER_API fractional_interpolator_cc_impl : public fractional_interpolator_cc { diff --git a/gr-filter/lib/fractional_interpolator_ff_impl.cc b/gr-filter/lib/fractional_interpolator_ff_impl.cc index 8728a05241..60730aa6be 100644 --- a/gr-filter/lib/fractional_interpolator_ff_impl.cc +++ b/gr-filter/lib/fractional_interpolator_ff_impl.cc @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + fractional_interpolator_ff::sptr fractional_interpolator_ff::make(float phase_shift, float interp_ratio) { diff --git a/gr-filter/lib/fractional_interpolator_ff_impl.h b/gr-filter/lib/fractional_interpolator_ff_impl.h index 41c5db7e77..3b3047888f 100644 --- a/gr-filter/lib/fractional_interpolator_ff_impl.h +++ b/gr-filter/lib/fractional_interpolator_ff_impl.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + class FILTER_API fractional_interpolator_ff_impl : public fractional_interpolator_ff { diff --git a/gr-filter/lib/fractional_resampler_cc_impl.cc b/gr-filter/lib/fractional_resampler_cc_impl.cc index b17e13638b..72a2262605 100644 --- a/gr-filter/lib/fractional_resampler_cc_impl.cc +++ b/gr-filter/lib/fractional_resampler_cc_impl.cc @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + fractional_resampler_cc::sptr fractional_resampler_cc::make(float phase_shift, float resamp_ratio) { diff --git a/gr-filter/lib/fractional_resampler_cc_impl.h b/gr-filter/lib/fractional_resampler_cc_impl.h index f4a5ead56e..d88d595370 100644 --- a/gr-filter/lib/fractional_resampler_cc_impl.h +++ b/gr-filter/lib/fractional_resampler_cc_impl.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + class FILTER_API fractional_resampler_cc_impl : public fractional_resampler_cc { diff --git a/gr-filter/lib/fractional_resampler_ff_impl.cc b/gr-filter/lib/fractional_resampler_ff_impl.cc index 131ccaae4e..2ffccf5204 100644 --- a/gr-filter/lib/fractional_resampler_ff_impl.cc +++ b/gr-filter/lib/fractional_resampler_ff_impl.cc @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + fractional_resampler_ff::sptr fractional_resampler_ff::make(float phase_shift, float resamp_ratio) { diff --git a/gr-filter/lib/fractional_resampler_ff_impl.h b/gr-filter/lib/fractional_resampler_ff_impl.h index 7e7fcc0ad4..11c9886176 100644 --- a/gr-filter/lib/fractional_resampler_ff_impl.h +++ b/gr-filter/lib/fractional_resampler_ff_impl.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + class FILTER_API fractional_resampler_ff_impl : public fractional_resampler_ff { diff --git a/gr-filter/lib/hilbert_fc_impl.cc b/gr-filter/lib/hilbert_fc_impl.cc index 5a066ac27c..0bdfb7041b 100644 --- a/gr-filter/lib/hilbert_fc_impl.cc +++ b/gr-filter/lib/hilbert_fc_impl.cc @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + hilbert_fc::sptr hilbert_fc::make(unsigned int ntaps, firdes::win_type window, @@ -48,7 +48,7 @@ namespace gr { io_signature::make(1, 1, sizeof(gr_complex))), d_ntaps(ntaps | 0x1) // ensure ntaps is odd { - d_hilb = new kernel::fir_filter_fff(1, + d_hilb = new kernel::fir_filter_fff(1, firdes::hilbert(d_ntaps, window, beta)); set_history(d_ntaps); @@ -69,12 +69,12 @@ namespace gr { { float *in = (float *)input_items[0]; gr_complex *out = (gr_complex *)output_items[0]; - + for(int i = 0; i < noutput_items; i++) { out[i] = gr_complex(in[i + d_ntaps/2], d_hilb->filter(&in[i])); } - + return noutput_items; } diff --git a/gr-filter/lib/hilbert_fc_impl.h b/gr-filter/lib/hilbert_fc_impl.h index 70968b15f2..fa46a057f9 100644 --- a/gr-filter/lib/hilbert_fc_impl.h +++ b/gr-filter/lib/hilbert_fc_impl.h @@ -42,7 +42,7 @@ namespace gr { double beta=6.76); ~hilbert_fc_impl(); - + int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/gr-filter/lib/iir_filter_ccc_impl.cc b/gr-filter/lib/iir_filter_ccc_impl.cc index f1f0dbe4ed..e813cd933d 100644 --- a/gr-filter/lib/iir_filter_ccc_impl.cc +++ b/gr-filter/lib/iir_filter_ccc_impl.cc @@ -29,7 +29,7 @@ namespace gr { namespace filter { - + iir_filter_ccc::sptr iir_filter_ccc::make(const std::vector<gr_complex> &fftaps, const std::vector<gr_complex> &fbtaps, diff --git a/gr-filter/lib/iir_filter_ccd_impl.cc b/gr-filter/lib/iir_filter_ccd_impl.cc index 8616b6deac..ebe53e925a 100644 --- a/gr-filter/lib/iir_filter_ccd_impl.cc +++ b/gr-filter/lib/iir_filter_ccd_impl.cc @@ -29,7 +29,7 @@ namespace gr { namespace filter { - + iir_filter_ccd::sptr iir_filter_ccd::make(const std::vector<double> &fftaps, const std::vector<double> &fbtaps, diff --git a/gr-filter/lib/iir_filter_ccf_impl.cc b/gr-filter/lib/iir_filter_ccf_impl.cc index 5132bdfedf..bb19e4550d 100644 --- a/gr-filter/lib/iir_filter_ccf_impl.cc +++ b/gr-filter/lib/iir_filter_ccf_impl.cc @@ -29,7 +29,7 @@ namespace gr { namespace filter { - + iir_filter_ccf::sptr iir_filter_ccf::make(const std::vector<float> &fftaps, const std::vector<float> &fbtaps, diff --git a/gr-filter/lib/iir_filter_ccz_impl.cc b/gr-filter/lib/iir_filter_ccz_impl.cc index 117aef5aa4..cb7b2300f5 100644 --- a/gr-filter/lib/iir_filter_ccz_impl.cc +++ b/gr-filter/lib/iir_filter_ccz_impl.cc @@ -29,7 +29,7 @@ namespace gr { namespace filter { - + iir_filter_ccz::sptr iir_filter_ccz::make(const std::vector<gr_complexd> &fftaps, const std::vector<gr_complexd> &fbtaps, diff --git a/gr-filter/lib/iir_filter_ffd_impl.cc b/gr-filter/lib/iir_filter_ffd_impl.cc index b61c80aabf..5aee5175c1 100644 --- a/gr-filter/lib/iir_filter_ffd_impl.cc +++ b/gr-filter/lib/iir_filter_ffd_impl.cc @@ -29,7 +29,7 @@ namespace gr { namespace filter { - + iir_filter_ffd::sptr iir_filter_ffd::make(const std::vector<double> &fftaps, const std::vector<double> &fbtaps, diff --git a/gr-filter/lib/interp_fir_filter_XXX_impl.cc.t b/gr-filter/lib/interp_fir_filter_XXX_impl.cc.t index 1a3a49ea31..507322b21d 100644 --- a/gr-filter/lib/interp_fir_filter_XXX_impl.cc.t +++ b/gr-filter/lib/interp_fir_filter_XXX_impl.cc.t @@ -33,7 +33,7 @@ namespace gr { namespace filter { - + @BASE_NAME@::sptr @BASE_NAME@::make(unsigned interpolation, const std::vector<@TAP_TYPE@> &taps) diff --git a/gr-filter/lib/mmse_fir_interpolator_cc.cc b/gr-filter/lib/mmse_fir_interpolator_cc.cc index 5d711ecc81..848dadda7e 100644 --- a/gr-filter/lib/mmse_fir_interpolator_cc.cc +++ b/gr-filter/lib/mmse_fir_interpolator_cc.cc @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + mmse_fir_interpolator_cc::mmse_fir_interpolator_cc() { filters.resize (NSTEPS + 1); diff --git a/gr-filter/lib/mmse_fir_interpolator_ff.cc b/gr-filter/lib/mmse_fir_interpolator_ff.cc index f4cf6c3862..0c8fcfad53 100644 --- a/gr-filter/lib/mmse_fir_interpolator_ff.cc +++ b/gr-filter/lib/mmse_fir_interpolator_ff.cc @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + mmse_fir_interpolator_ff::mmse_fir_interpolator_ff() { filters.resize(NSTEPS + 1); diff --git a/gr-filter/lib/pfb_arb_resampler_ccf_impl.cc b/gr-filter/lib/pfb_arb_resampler_ccf_impl.cc index 2b59723d62..aa6cb775ae 100644 --- a/gr-filter/lib/pfb_arb_resampler_ccf_impl.cc +++ b/gr-filter/lib/pfb_arb_resampler_ccf_impl.cc @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + pfb_arb_resampler_ccf::sptr pfb_arb_resampler_ccf::make(float rate, const std::vector<float> &taps, @@ -85,7 +85,7 @@ namespace gr { set_history(d_resamp->taps_per_filter()); d_updated = true; } - + std::vector<std::vector<float> > pfb_arb_resampler_ccf_impl::taps() const { @@ -122,7 +122,7 @@ namespace gr { unsigned int pfb_arb_resampler_ccf_impl::interpolation_rate() const - { + { return d_resamp->interpolation_rate(); } diff --git a/gr-filter/lib/pfb_arb_resampler_fff_impl.cc b/gr-filter/lib/pfb_arb_resampler_fff_impl.cc index 1d0cdee95b..e82ef31625 100644 --- a/gr-filter/lib/pfb_arb_resampler_fff_impl.cc +++ b/gr-filter/lib/pfb_arb_resampler_fff_impl.cc @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + pfb_arb_resampler_fff::sptr pfb_arb_resampler_fff::make(float rate, const std::vector<float> &taps, @@ -85,7 +85,7 @@ namespace gr { set_history(d_resamp->taps_per_filter()); d_updated = true; } - + std::vector<std::vector<float> > pfb_arb_resampler_fff_impl::taps() const { @@ -122,7 +122,7 @@ namespace gr { unsigned int pfb_arb_resampler_fff_impl::interpolation_rate() const - { + { return d_resamp->interpolation_rate(); } diff --git a/gr-filter/lib/pfb_interpolator_ccf_impl.h b/gr-filter/lib/pfb_interpolator_ccf_impl.h index 6bc1d4b789..c4dc3c3d16 100644 --- a/gr-filter/lib/pfb_interpolator_ccf_impl.h +++ b/gr-filter/lib/pfb_interpolator_ccf_impl.h @@ -32,7 +32,7 @@ namespace gr { namespace filter { - + class FILTER_API pfb_interpolator_ccf_impl : public pfb_interpolator_ccf, kernel::polyphase_filterbank { private: diff --git a/gr-filter/lib/pfb_synthesizer_ccf_impl.h b/gr-filter/lib/pfb_synthesizer_ccf_impl.h index e83865a7ff..cbe4064a3e 100644 --- a/gr-filter/lib/pfb_synthesizer_ccf_impl.h +++ b/gr-filter/lib/pfb_synthesizer_ccf_impl.h @@ -31,7 +31,7 @@ namespace gr { namespace filter { - + // While this is a polyphase_filterbank, we don't use the normal // parent class because we have to use the fir_filter_with_buffer // objects instead of normal filters. diff --git a/gr-filter/lib/pm_remez.cc b/gr-filter/lib/pm_remez.cc index c23095af25..ea351766a5 100644 --- a/gr-filter/lib/pm_remez.cc +++ b/gr-filter/lib/pm_remez.cc @@ -97,7 +97,7 @@ namespace gr { * double D[] - Desired response on the dense grid [gridsize] * double W[] - Weight function on the dense grid [gridsize] *******************/ - + static void create_dense_grid(int r, int numtaps, int numband, const double bands[], const double des[], const double weight[], int gridsize, @@ -129,7 +129,7 @@ namespace gr { } Grid[j-1] = highf; } - + /* * Similar to above, if odd symmetry, last grid point can't be .5 * - but, if there are even taps, leave the last grid point at .5 @@ -158,12 +158,12 @@ namespace gr { * ------- * int ext[] - Extremal indexes to dense frequency grid [r+1] ********************/ - + static void initial_guess(int r, int Ext[], int gridsize) { int i; - + for(i=0; i<=r; i++) Ext[i] = i * (gridsize-1) / r; } @@ -195,7 +195,7 @@ namespace gr { { int i, j, k, ld; double sign, xi, delta, denom, numer; - + /* * Find x[] */ @@ -262,13 +262,13 @@ namespace gr { * ------- * Returns double value of A[freq] *********************/ - + static double compute_A(double freq, int r, double ad[], double x[], double y[]) { int i; double xc, c, denom, numer; - + denom = numer = 0; xc = cos(Pi2 * freq); for(i = 0; i <= r; i++) { @@ -317,7 +317,7 @@ namespace gr { { int i; double A; - + for(i = 0; i < gridsize; i++) { A = compute_A(Grid[i], r, ad, x, y); E[i] = W[i] * (D[i] - A); @@ -355,20 +355,20 @@ namespace gr { int i, j, k, l, extra; /* Counters */ int up, alt; int *foundExt; /* Array of found extremals */ - + /* * Allocate enough space for found extremals. */ foundExt = (int *)malloc((2*r) * sizeof(int)); k = 0; - + /* * Check for extremum at 0. */ if(((E[0] > 0.0) && (E[0] > E[1])) || ((E[0] < 0.0) && (E[0] < E[1]))) foundExt[k++] = 0; - + /* * Check for extrema inside dense grid */ @@ -396,13 +396,13 @@ namespace gr { } foundExt[k++] = j; } - + // PAK: we sometimes get not enough extremal frequencies if(k < r+1) { free(foundExt); return -2; } - + /* * Remove extra extremals */ @@ -435,7 +435,7 @@ namespace gr { break; /* Ooops, found two non-alternating */ } /* extrema. Delete smallest of them */ } /* if the loop finishes, all extrema are alternating */ - + /* * If there's only one extremal and all are alternating, * delete the smallest of the first/last extremals. @@ -450,7 +450,7 @@ namespace gr { l = 0; // PAK: changed from l = foundExt[0]; } - + for(j = l; j < k-1; j++) { /* Loop that does the deletion */ foundExt[j] = foundExt[j+1]; assert(foundExt[j]<gridsize); @@ -458,7 +458,7 @@ namespace gr { k--; extra--; } - + for(i = 0; i <= r; i++) { assert(foundExt[i]<gridsize); Ext[i] = foundExt[i]; /* Copy found extremals to Ext[] */ @@ -468,7 +468,7 @@ namespace gr { return 0; } - + /********************* * freq_sample *============ @@ -491,7 +491,7 @@ namespace gr { { int n, k; double x, val, M; - + M = (N-1.0)/2.0; if(symm == POSITIVE) { if(N % 2) { @@ -558,7 +558,7 @@ namespace gr { { int i; double min, max, current; - + min = max = fabs(E[Ext[0]]); for(i = 1; i <= r; i++) { current = fabs(E[Ext[i]]); @@ -604,12 +604,12 @@ namespace gr { double *taps, c; double *x, *y, *ad; int symmetry; - + if(type == BANDPASS) symmetry = POSITIVE; else symmetry = NEGATIVE; - + r = numtaps/2; /* number of extrema */ if((numtaps % 2) && (symmetry == POSITIVE)) r++; @@ -625,7 +625,7 @@ namespace gr { if(symmetry == NEGATIVE) { gridsize--; } - + /* * Dynamically allocate memory for arrays with proper sizes */ @@ -638,7 +638,7 @@ namespace gr { x = (double *)malloc((r+1) * sizeof(double)); y = (double *)malloc((r+1) * sizeof(double)); ad = (double *)malloc((r+1) * sizeof(double)); - + /* * Create dense frequency grid */ @@ -686,7 +686,7 @@ namespace gr { } } } - + /* * Perform the Remez Exchange algorithm */ @@ -739,7 +739,7 @@ namespace gr { * Frequency sampling design with calculated taps */ freq_sample(numtaps, taps, h, symmetry); - + /* * Delete allocated memory */ @@ -794,7 +794,7 @@ namespace gr { if(arg_bands[0] < 0 || arg_bands[arg_bands.size() - 1] > 1) punt("gr_remez: band edges must be in the range [0,1]"); - + // Divide by 2 to fit with the implementation that uses a // sample rate of [0, 0.5] instead of [0, 1.0] for(int i = 0; i < 2 * numbands; i++) @@ -806,11 +806,11 @@ namespace gr { for(int i = 0; i < 2 * numbands; i++) response[i] = arg_response[i]; - + LOCAL_BUFFER(double, weight, numbands); for(int i = 0; i < numbands; i++) weight[i] = 1.0; - + if(arg_weight.size() != 0) { if((int) arg_weight.size() != numbands) punt("gr_remez: need one weight for each band [=length(band)/2]"); @@ -837,13 +837,13 @@ namespace gr { if(err == -1) punt("gr_remez: failed to converge"); - + if(err == -2) punt("gr_remez: insufficient extremals -- cannot continue"); if(err == -3) punt("gr_remez: too many extremals -- cannot continue"); - + return std::vector<double>(&coeff[0], &coeff[numtaps]); } diff --git a/gr-filter/lib/qa_fir_filter_with_buffer.cc b/gr-filter/lib/qa_fir_filter_with_buffer.cc index 06d44f6eee..a1dd9f4e48 100644 --- a/gr-filter/lib/qa_fir_filter_with_buffer.cc +++ b/gr-filter/lib/qa_fir_filter_with_buffer.cc @@ -41,7 +41,7 @@ namespace gr { #define ERR_DELTA (1e-5) static float - uniform() + uniform() { return 2.0 * ((float)(::random()) / RANDOM_MAX - 0.5); // uniformly (-1, 1) } @@ -310,7 +310,7 @@ namespace gr { sum += input[i] * taps[i]; } - //return gr_complex(121,9)*sum; + //return gr_complex(121,9)*sum; return sum; } diff --git a/gr-filter/lib/qa_fir_filter_with_buffer.h b/gr-filter/lib/qa_fir_filter_with_buffer.h index 8850ada20c..b3bb9c874e 100644 --- a/gr-filter/lib/qa_fir_filter_with_buffer.h +++ b/gr-filter/lib/qa_fir_filter_with_buffer.h @@ -30,7 +30,7 @@ namespace gr { namespace fff { - class qa_fir_filter_with_buffer_fff : public CppUnit::TestCase + class qa_fir_filter_with_buffer_fff : public CppUnit::TestCase { CPPUNIT_TEST_SUITE(qa_fir_filter_with_buffer_fff); CPPUNIT_TEST(t1); @@ -50,7 +50,7 @@ namespace gr { namespace ccc { - class qa_fir_filter_with_buffer_ccc : public CppUnit::TestCase + class qa_fir_filter_with_buffer_ccc : public CppUnit::TestCase { CPPUNIT_TEST_SUITE(qa_fir_filter_with_buffer_ccc); CPPUNIT_TEST(t1); @@ -70,7 +70,7 @@ namespace gr { namespace ccf { - class qa_fir_filter_with_buffer_ccf : public CppUnit::TestCase + class qa_fir_filter_with_buffer_ccf : public CppUnit::TestCase { CPPUNIT_TEST_SUITE(qa_fir_filter_with_buffer_ccf); CPPUNIT_TEST(t1); diff --git a/gr-filter/lib/qa_firdes.h b/gr-filter/lib/qa_firdes.h index b27cf78b91..6b3cc7dc30 100644 --- a/gr-filter/lib/qa_firdes.h +++ b/gr-filter/lib/qa_firdes.h @@ -27,9 +27,9 @@ namespace gr { namespace filter { - + class qa_firdes : public CppUnit::TestCase { - + CPPUNIT_TEST_SUITE(qa_firdes); CPPUNIT_TEST(t1); CPPUNIT_TEST(t2); @@ -39,7 +39,7 @@ namespace gr { CPPUNIT_TEST(t6); CPPUNIT_TEST(t7); CPPUNIT_TEST_SUITE_END(); - + private: void t1(); void t2(); @@ -49,7 +49,7 @@ namespace gr { void t6(); void t7(); }; - + } /* namespace filter */ } /* namespace gr */ diff --git a/gr-filter/lib/qa_mmse_fir_interpolator_cc.cc b/gr-filter/lib/qa_mmse_fir_interpolator_cc.cc index 8057e1d3ce..9766cb93a3 100644 --- a/gr-filter/lib/qa_mmse_fir_interpolator_cc.cc +++ b/gr-filter/lib/qa_mmse_fir_interpolator_cc.cc @@ -36,7 +36,7 @@ namespace gr { namespace filter { - + static float test_fcn_sin(double index) { diff --git a/gr-filter/lib/qa_mmse_fir_interpolator_cc.h b/gr-filter/lib/qa_mmse_fir_interpolator_cc.h index a45965ca27..3ae3c8e4fd 100644 --- a/gr-filter/lib/qa_mmse_fir_interpolator_cc.h +++ b/gr-filter/lib/qa_mmse_fir_interpolator_cc.h @@ -28,8 +28,8 @@ namespace gr { namespace filter { - - class qa_mmse_fir_interpolator_cc : public CppUnit::TestCase + + class qa_mmse_fir_interpolator_cc : public CppUnit::TestCase { CPPUNIT_TEST_SUITE(qa_mmse_fir_interpolator_cc); CPPUNIT_TEST(t1); diff --git a/gr-filter/lib/qa_mmse_fir_interpolator_ff.cc b/gr-filter/lib/qa_mmse_fir_interpolator_ff.cc index b2e3d34502..e9ee937230 100644 --- a/gr-filter/lib/qa_mmse_fir_interpolator_ff.cc +++ b/gr-filter/lib/qa_mmse_fir_interpolator_ff.cc @@ -34,7 +34,7 @@ namespace gr { namespace filter { - + static float test_fcn(double index) { diff --git a/gr-filter/lib/qa_mmse_fir_interpolator_ff.h b/gr-filter/lib/qa_mmse_fir_interpolator_ff.h index 833ec173ac..609c6a2daf 100644 --- a/gr-filter/lib/qa_mmse_fir_interpolator_ff.h +++ b/gr-filter/lib/qa_mmse_fir_interpolator_ff.h @@ -28,7 +28,7 @@ namespace gr { namespace filter { - + class qa_mmse_fir_interpolator_ff : public CppUnit::TestCase { CPPUNIT_TEST_SUITE(qa_mmse_fir_interpolator_ff); diff --git a/gr-filter/lib/rational_resampler_base_XXX_impl.cc.t b/gr-filter/lib/rational_resampler_base_XXX_impl.cc.t index 755b267517..ef98af3037 100644 --- a/gr-filter/lib/rational_resampler_base_XXX_impl.cc.t +++ b/gr-filter/lib/rational_resampler_base_XXX_impl.cc.t @@ -33,7 +33,7 @@ namespace gr { namespace filter { - + @BASE_NAME@::sptr @BASE_NAME@::make(unsigned interpolation, unsigned decimation, diff --git a/gr-filter/lib/single_pole_iir_filter_cc_impl.cc b/gr-filter/lib/single_pole_iir_filter_cc_impl.cc index ecfe8f05ee..1bab177531 100644 --- a/gr-filter/lib/single_pole_iir_filter_cc_impl.cc +++ b/gr-filter/lib/single_pole_iir_filter_cc_impl.cc @@ -30,7 +30,7 @@ namespace gr { namespace filter { - + single_pole_iir_filter_cc::sptr single_pole_iir_filter_cc::make(double alpha, unsigned int vlen) { diff --git a/gr-filter/lib/single_pole_iir_filter_ff_impl.cc b/gr-filter/lib/single_pole_iir_filter_ff_impl.cc index 23d9814eb4..d948afbc14 100644 --- a/gr-filter/lib/single_pole_iir_filter_ff_impl.cc +++ b/gr-filter/lib/single_pole_iir_filter_ff_impl.cc @@ -29,7 +29,7 @@ namespace gr { namespace filter { - + single_pole_iir_filter_ff::sptr single_pole_iir_filter_ff::make(double alpha, unsigned int vlen) { diff --git a/gr-filter/python/filter/CMakeLists.txt b/gr-filter/python/filter/CMakeLists.txt index c708f0a7d8..1dd055abaf 100644 --- a/gr-filter/python/filter/CMakeLists.txt +++ b/gr-filter/python/filter/CMakeLists.txt @@ -36,13 +36,13 @@ GR_PYTHON_INSTALL( # Handle the unit tests ######################################################################## if(ENABLE_TESTING) - + set(GR_TEST_TARGET_DEPS "") set(GR_TEST_LIBRARY_DIRS "") set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/gnuradio-runtime/python ) - + include(GrTest) file(GLOB py_qa_test_files "qa_*.py") foreach(py_qa_test_file ${py_qa_test_files}) diff --git a/gr-filter/python/filter/design/api_object.py b/gr-filter/python/filter/design/api_object.py index 8e3687d37e..7661265c75 100644 --- a/gr-filter/python/filter/design/api_object.py +++ b/gr-filter/python/filter/design/api_object.py @@ -21,12 +21,12 @@ class ApiObject(): ''' Filter count variable if the filter design tool has to - return multiple filter paramters in future + return multiple filter paramters in future e.g Cascaded Filters ''' def __init__(self, filtcount = 1): self.filtercount = filtcount - self.restype = [''] * self.filtercount + self.restype = [''] * self.filtercount self.params = [''] * self.filtercount self.taps = [''] * self.filtercount @@ -42,38 +42,38 @@ class ApiObject(): ''' def update_filttype(self, filttype, filtno): if (filtno <= self.filtercount): - self.filttype[filtno - 1] = filttype + self.filttype[filtno - 1] = filttype ''' - updates taps for the given filter number. taps will + updates taps for the given filter number. taps will contain a list of coefficients in the case of fir design - and (b,a) tuple in the case of iir design + and (b,a) tuple in the case of iir design ''' def update_taps(self, taps, filtno): if (filtno <= self.filtercount): - self.taps[filtno - 1] = taps + self.taps[filtno - 1] = taps ''' - updates all of them in a single call + updates all of them in a single call ''' def update_all(self, filttype, params, taps, filtno): if (filtno <= self.filtercount): - self.taps[filtno - 1] = taps + self.taps[filtno - 1] = taps self.params[filtno - 1] = params - self.restype[filtno - 1] = filttype + self.restype[filtno - 1] = filttype def get_filtercount(self): return self.filtercount - + def get_restype(self, filtno=1): if (filtno <= self.filtercount): return self.restype[filtno - 1] - + def get_params(self, filtno=1): if (filtno <= self.filtercount): return self.params[filtno - 1] - + def get_taps(self, filtno=1): if (filtno <= self.filtercount): return self.taps[filtno - 1] diff --git a/gr-filter/python/filter/design/filter_design.py b/gr-filter/python/filter/design/filter_design.py index 748a435c63..fe90681e34 100644 --- a/gr-filter/python/filter/design/filter_design.py +++ b/gr-filter/python/filter/design/filter_design.py @@ -49,31 +49,31 @@ except ImportError: raise SystemExit, 1 try: - from gnuradio.filter.banditems import * + from gnuradio.filter.banditems import * except ImportError: print "Could not import from banditems. Please check whether banditems.py is in the library path" raise SystemExit, 1 try: - from gnuradio.filter.polezero_plot import * + from gnuradio.filter.polezero_plot import * except ImportError: print "Could not import from polezero_plot. Please check whether polezero_plot.py is in the library path" raise SystemExit, 1 try: - from gnuradio.filter.idealbanditems import * + from gnuradio.filter.idealbanditems import * except ImportError: print "Could not import from idealbanditems. Please check whether idealbanditems.py is in the library path" raise SystemExit, 1 try: - from gnuradio.filter.api_object import * + from gnuradio.filter.api_object import * except ImportError: print "Could not import from api_object. Please check whether api_object.py is in the library path" raise SystemExit, 1 try: - from gnuradio.filter.fir_design import * + from gnuradio.filter.fir_design import * except ImportError: print "Could not import from fir_design. Please check whether fir_design.py is in the library path" raise SystemExit, 1 @@ -91,8 +91,8 @@ class gr_plot_filter(QtGui.QMainWindow): self.gui = Ui_MainWindow() self.callback = callback self.gui.setupUi(self) - - #Remove other filter combobox entry if + + #Remove other filter combobox entry if #some restriction is specified if restype == "iir": ind = self.gui.fselectComboBox.findText("FIR") @@ -142,7 +142,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.connect(self.gui.actionQuick_Access, Qt.SIGNAL("activated()"), self.action_quick_access) - + self.connect(self.gui.actionSpec_Widget, Qt.SIGNAL("activated()"), self.action_spec_widget) @@ -166,7 +166,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.connect(self.gui.actionPhase_Respone, Qt.SIGNAL("activated()"), self.set_actphase) - + self.connect(self.gui.actionGroup_Delay, Qt.SIGNAL("activated()"), self.set_actgdelay) @@ -186,7 +186,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.connect(self.gui.actionPole_Zero_Plot_2, Qt.SIGNAL("activated()"), self.set_actpzplot) - + self.connect(self.gui.actionGridview, Qt.SIGNAL("activated()"), self.set_switchview) @@ -194,7 +194,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.connect(self.gui.actionPlot_select, Qt.SIGNAL("activated()"), self.set_plotselect) - + self.connect(self.gui.actionPhase_Delay, Qt.SIGNAL("activated()"), self.set_actpdelay) @@ -282,7 +282,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.connect(self.gui.checkMagres, Qt.SIGNAL("stateChanged(int)"), self.set_magresponse) - + self.connect(self.gui.checkGdelay, Qt.SIGNAL("stateChanged(int)"), self.set_gdelay) @@ -298,7 +298,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.connect(self.gui.checkBand, Qt.SIGNAL("stateChanged(int)"), self.set_band) - + self.connect(self.gui.checkPzplot, Qt.SIGNAL("stateChanged(int)"), self.set_pzplot) @@ -314,11 +314,11 @@ class gr_plot_filter(QtGui.QMainWindow): self.connect(self.gui.checkStep, Qt.SIGNAL("stateChanged(int)"), self.set_stepres) - + self.gridenable = False self.mfoverlay = False self.mtoverlay = False - self.iir = False + self.iir = False self.gui.designButton.setShortcut(QtCore.Qt.Key_Return) @@ -402,7 +402,7 @@ class gr_plot_filter(QtGui.QMainWindow): mtxtitle) self.gui.mtimePlot.setAxisTitle(self.gui.freqPlot.yLeft, mtytitle) - + phytitle = Qwt.QwtText("Phase Delay") phytitle.setFont(Qt.QFont("Helvetica", 11, Qt.QFont.Bold)) self.gui.pdelayPlot.setAxisTitle(self.gui.groupPlot.xBottom, @@ -433,7 +433,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.steprescurve = Qwt.QwtPlotCurve("Step Response") self.steprescurve.attach(self.gui.stepresPlot) - + self.steprescurve_i = Qwt.QwtPlotCurve("Step Response Imag") self.steprescurve_i.attach(self.gui.stepresPlot) @@ -496,14 +496,14 @@ class gr_plot_filter(QtGui.QMainWindow): Qwt.QwtPicker.PointSelection, Qwt.QwtPicker.AlwaysOn, self.gui.freqPlot.canvas()) - + self.mfreqZoomer = Qwt.QwtPlotZoomer(self.gui.mfreqPlot.xBottom, self.gui.mfreqPlot.yLeft, Qwt.QwtPicker.PointSelection, Qwt.QwtPicker.AlwaysOn, self.gui.mfreqPlot.canvas()) - + self.mfreqZoomer2 = Qwt.QwtPlotZoomer(self.gui.mfreqPlot.xBottom, self.gui.mfreqPlot.yRight, Qwt.QwtPicker.PointSelection, @@ -546,7 +546,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.hpfitems = hpfItems self.bpfitems = bpfItems self.bnfitems = bnfItems - + #Connect signals self.lpfitems[0].attenChanged.connect(self.set_fatten) @@ -567,7 +567,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.cpicker = CanvasPicker(self.gui.pzPlot) self.cpicker.curveChanged.connect(self.set_curvetaps) self.cpicker.mouseposChanged.connect(self.set_statusbar) - + self.cpicker2 = CanvasPicker(self.gui.mpzPlot) self.cpicker2.curveChanged.connect(self.set_mcurvetaps) self.cpicker2.mouseposChanged.connect(self.set_mstatusbar) @@ -579,7 +579,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.lpfstartproxy=QtGui.QGraphicsProxyWidget() self.lpfstartproxy.setWidget(self.lpfpassEdit) self.lpfstartproxy.setPos(400,30) - + self.lpfstopEdit=QtGui.QLineEdit() self.lpfstopEdit.setMaximumSize(QtCore.QSize(75,20)) self.lpfstopEdit.setText(Qt.QString("Not set")) @@ -876,7 +876,7 @@ class gr_plot_filter(QtGui.QMainWindow): # Do FIR design def design_fir(self, ftype, fs, gain, winstr): - self.iir = False + self.iir = False self.cpicker.set_iir(False) self.cpicker2.set_iir(False) if(winstr == "Equiripple"): @@ -938,7 +938,7 @@ class gr_plot_filter(QtGui.QMainWindow): iirft = {"Elliptic" : 'ellip', "Butterworth" : 'butter', "Chebyshev-1" : 'cheby1', - "Chebyshev-2" : 'cheby2', + "Chebyshev-2" : 'cheby2', "Bessel" : 'bessel' } sanalog = {"Analog (rad/second)" : 1, @@ -977,8 +977,8 @@ class gr_plot_filter(QtGui.QMainWindow): self.gui.iirBsfStopBandRippleEdit.text().toDouble()] } #Remove Ideal band-diagrams if IIR self.set_drawideal() - for i in range(len(iirboxes[iirbtype])): - params.append(iirboxes[iirbtype][i][0]) + for i in range(len(iirboxes[iirbtype])): + params.append(iirboxes[iirbtype][i][0]) ret = iirboxes[iirbtype][i][1] and ret if len(iirboxes[iirbtype]) == 6: @@ -1019,7 +1019,7 @@ class gr_plot_filter(QtGui.QMainWindow): e.args[0], "&Ok") (self.z,self.p,self.k) = signal.tf2zpk(self.b,self.a) #Create params - iirparams = { "filttype": iirft[iirftype], "bandtype": iirabbr[iirbtype],"paramtype":paramtype[sanalog[atype]], + iirparams = { "filttype": iirft[iirftype], "bandtype": iirabbr[iirbtype],"paramtype":paramtype[sanalog[atype]], "pbedge": params[0], "sbedge": params[1],"gpass": params[2], "gstop": params[3]} self.gui.pzPlot.insertZeros(self.z) @@ -1036,12 +1036,12 @@ class gr_plot_filter(QtGui.QMainWindow): retobj.update_all("iir", self.params, (self.b, self.a), 1) self.callback(retobj) - # IIR Filter design plot updates + # IIR Filter design plot updates def iir_plot_all(self,z,p,k): self.b,self.a = signal.zpk2tf(z,p,k) w,h = signal.freqz(self.b,self.a) self.fftdB = 20 * scipy.log10 (abs(h)) - self.freq = w/max(w) + self.freq = w/max(w) self.fftDeg = scipy.unwrap(scipy.arctan2(imag(h),real(h))) self.groupDelay = -scipy.diff(self.fftDeg) self.phaseDelay = -self.fftDeg[1:]/self.freq[1:] @@ -1289,7 +1289,7 @@ class gr_plot_filter(QtGui.QMainWindow): xmin, xmax) self.gui.phasePlot.setAxisScale(self.gui.phasePlot.yLeft, ymin, ymax) - + if self.mfoverlay: self.gui.mfreqPlot.setAxisScale(self.gui.mfreqPlot.xBottom, xmin, xmax) @@ -1304,7 +1304,7 @@ class gr_plot_filter(QtGui.QMainWindow): xmin, xmax) self.gui.mfreqPlot.setAxisScale(self.gui.mfreqPlot.yLeft, ymin, ymax) - + #Set Axis title self.gui.mfreqPlot.setAxisTitle(self.phasecurve.yAxis(), pytitle) @@ -1355,7 +1355,7 @@ class gr_plot_filter(QtGui.QMainWindow): xmin, xmax) self.gui.mfreqPlot.setAxisScale(self.gui.mfreqPlot.yLeft, ymin, ymax) - + #Set Axis title self.gui.mfreqPlot.setAxisTitle(self.groupcurve.yAxis(), gytitle) @@ -1407,7 +1407,7 @@ class gr_plot_filter(QtGui.QMainWindow): #Set Axis title self.gui.mfreqPlot.setAxisTitle(self.pdelaycurve.yAxis(), phytitle) - + # Set the zoomer base to unzoom to the new axis self.pdelayZoomer.setZoomBase() self.mfreqZoomer.setZoomBase() @@ -1452,30 +1452,30 @@ class gr_plot_filter(QtGui.QMainWindow): self.bufferplots = [] else: self.bufferplots = [] - #Iterate through tabgroup children and copy curves + #Iterate through tabgroup children and copy curves for i in range(self.gui.tabGroup.count()): page = self.gui.tabGroup.widget(i) for item in page.children(): if isinstance(item, Qwt.QwtPlot): - #Change colours as both plots overlay + #Change colours as both plots overlay colours = [QtCore.Qt.darkYellow,QtCore.Qt.black] for c in item.itemList(): if isinstance(c, Qwt.QwtPlotCurve): - dup = Qwt.QwtPlotCurve() - dpen = c.pen() - dsym = c.symbol() - dsym.setPen(Qt.QPen(colours[0])) - dsym.setSize(Qt.QSize(6, 6)) - dpen.setColor(colours[0]) - del colours[0] - dup.setPen(dpen) - dup.setSymbol(dsym) + dup = Qwt.QwtPlotCurve() + dpen = c.pen() + dsym = c.symbol() + dsym.setPen(Qt.QPen(colours[0])) + dsym.setSize(Qt.QSize(6, 6)) + dpen.setColor(colours[0]) + del colours[0] + dup.setPen(dpen) + dup.setSymbol(dsym) dup.setRenderHint(Qwt.QwtPlotItem.RenderAntialiased) dup.setData([c.x(i) for i in range(c.dataSize())], [c.y(i) for i in range(c.dataSize())]) - self.bufferplots.append(dup) - self.bufferplots[-1].attach(item) - + self.bufferplots.append(dup) + self.bufferplots[-1].attach(item) + def set_grid(self): if (self.gui.checkGrid.checkState() == 0 ): self.gridenable=False @@ -1497,7 +1497,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.pdelaygrid.attach(self.gui.pdelayPlot) self.ftapsgrid.attach(self.gui.timePlot) self.replot_all() - + def set_actgrid(self): if (self.gui.actionGrid_2.isChecked() == 0 ): self.gridenable=False @@ -1528,7 +1528,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.magres=True self.gui.tabGroup.addTab(self.gui.freqTab, _fromUtf8("Magnitude Response")) self.update_freq_curves() - + def set_actmagresponse(self): if (self.gui.actionMagnitude_Response.isChecked() == 0 ): self.gui.tabGroup.removeTab(self.gui.tabGroup.indexOf(self.gui.freqTab)) @@ -1566,7 +1566,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.update_freq_curves() self.update_time_curves() self.set_drawideal() - + def set_plotselect(self): if (self.gui.actionPlot_select.isChecked() == 0 ): self.gui.mfgroupBox.hide() @@ -1598,7 +1598,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.impresgrid.detach() self.stepresgrid.detach() self.ftapsgrid.detach() - + def set_mfmagresponse(self): if self.mfoverlay: if not(self.ifinlist(self.freqcurve,self.gui.mfreqPlot.itemList())): @@ -1647,7 +1647,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.groupcurve.setYAxis(Qwt.QwtPlot.yLeft) self.groupcurve.attach(self.gui.mfreqPlot) self.update_group_curves() - + def set_mfphasedelay(self): if self.mfoverlay: if not(self.ifinlist(self.pdelaycurve,self.gui.mfreqPlot.itemList())): @@ -1689,8 +1689,8 @@ class gr_plot_filter(QtGui.QMainWindow): if plot is self.gui.mfreqPlot: items[1].setPen(QtGui.QPen(QtCore.Qt.red, 1, QtCore.Qt.SolidLine)) self.set_actgrid() - - + + def update_fft(self, taps, params): self.params = params self.taps = scipy.array(taps) @@ -1775,7 +1775,7 @@ class gr_plot_filter(QtGui.QMainWindow): else: self.gui.tabGroup.addTab(self.gui.groupTab, _fromUtf8("Group Delay")) self.update_freq_curves() - + def set_actgdelay(self): if (self.gui.actionGroup_Delay.isChecked() == 0 ): self.gui.tabGroup.removeTab(self.gui.tabGroup.indexOf(self.gui.groupTab)) @@ -1829,7 +1829,7 @@ class gr_plot_filter(QtGui.QMainWindow): plot = self.gui.mfreqPlot else: plot = self.gui.freqPlot - + if (self.gui.actionIdeal_Band.isChecked() == 0 or fsel == "IIR(scipy)"): self.idbanditems.detach_allidealcurves(plot) elif(self.params): @@ -1892,7 +1892,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.scene.addWidget(item) else: self.scene.addItem(item) - + def remove_bandview(self): for item in self.scene.items(): self.scene.removeItem(item) @@ -1902,7 +1902,7 @@ class gr_plot_filter(QtGui.QMainWindow): if (ftype == "Low Pass"): boxatten,r = self.gui.lpfStopBandAttenEdit.text().toDouble() self.gui.lpfStopBandAttenEdit.setText(Qt.QString(str(atten+boxatten))) - + if ftype == "High Pass": boxatten,r = self.gui.hpfStopBandAttenEdit.text().toDouble() self.gui.hpfStopBandAttenEdit.setText(Qt.QString(str(atten+boxatten))) @@ -1921,7 +1921,7 @@ class gr_plot_filter(QtGui.QMainWindow): #self.design() def set_curvetaps(self,(zr,pl)): - if self.iir: + if self.iir: self.z=zr self.p=pl self.iir_plot_all(self.z,self.p,self.k) @@ -1932,7 +1932,7 @@ class gr_plot_filter(QtGui.QMainWindow): retobj = ApiObject() retobj.update_all("iir", self.params, (self.b, self.a), 1) self.callback(retobj) - else: + else: hz = poly1d(zr,r=1) #print hz.c self.taps=hz.c*self.taps[0] @@ -1950,7 +1950,7 @@ class gr_plot_filter(QtGui.QMainWindow): self.callback(retobj) def set_mcurvetaps(self,(zr,pl)): - if self.iir: + if self.iir: self.z=zr self.p=pl self.iir_plot_all(self.z,self.p,self.k) @@ -1961,7 +1961,7 @@ class gr_plot_filter(QtGui.QMainWindow): retobj = ApiObject() retobj.update_all("iir", self.params, (self.b, self.a), 1) self.callback(retobj) - else: + else: hz = poly1d(zr,r=1) #print hz.c self.taps=hz.c*self.taps[0] @@ -1998,7 +1998,7 @@ class gr_plot_filter(QtGui.QMainWindow): def get_zeros(self): hz = poly1d(self.taps,r=0) return hz.r - + def get_poles(self): if len(self.taps): hp = zeros(len(self.taps)-1,complex) @@ -2047,7 +2047,7 @@ class gr_plot_filter(QtGui.QMainWindow): return csvhandle = csv.writer(handle, delimiter=",") - #indicate fir/iir for easy reading + #indicate fir/iir for easy reading if self.iir: csvhandle.writerow(["restype","iir"]) else: @@ -2105,7 +2105,7 @@ class gr_plot_filter(QtGui.QMainWindow): params[row[0]] = row[1] handle.close() if restype == "fir": - self.iir = False + self.iir = False self.gui.fselectComboBox.setCurrentIndex(0) self.draw_plots(taps, params) zeros=self.get_zeros() @@ -2192,8 +2192,8 @@ class gr_plot_filter(QtGui.QMainWindow): self.iir_plot_all(self.z,self.p,self.k) self.update_fcoeff() self.gui.nTapsEdit.setText("-") - self.params = params - + self.params = params + #Set GUI for IIR type iirft = { "ellip" : 0, "butter" : 1, @@ -2204,9 +2204,9 @@ class gr_plot_filter(QtGui.QMainWindow): paramtype = { "analog" : 1, "digital" : 0 } bandpos = { - "lpf" : 0, + "lpf" : 0, "bpf" : 1, - "bnf" : 2, + "bnf" : 2, "hpf" : 3} iirboxes = {"lpf" : [self.gui.iirendofLpfPassBandEdit, @@ -2248,7 +2248,7 @@ class gr_plot_filter(QtGui.QMainWindow): else: pbedge = map(float, params["pbedge"][1:-1].split(',')) sbedge = map(float, params["sbedge"][1:-1].split(',')) - sdata = [pbedge[0], pbedge[1], sbedge[0], + sdata = [pbedge[0], pbedge[1], sbedge[0], sbedge[1], params["gpass"], params["gstop"]] cboxes = iirboxes[params["bandtype"]] @@ -2290,14 +2290,14 @@ def launch(args, callback=None, restype=""): if gplt.iir: retobj = ApiObject() retobj.update_all("iir", gplt.params, (gplt.b, gplt.a), 1) - return retobj + return retobj else: retobj = ApiObject() retobj.update_all("fir", gplt.params, gplt.taps, 1) - return retobj + return retobj else: gplt = gr_plot_filter(options, callback, restype) - return gplt + return gplt def main(args): parser = setup_options() diff --git a/gr-filter/python/filter/design/fir_design.py b/gr-filter/python/filter/design/fir_design.py index 494cda3723..e27b065781 100644 --- a/gr-filter/python/filter/design/fir_design.py +++ b/gr-filter/python/filter/design/fir_design.py @@ -19,7 +19,7 @@ # import scipy -from gnuradio import filter +from gnuradio import filter from PyQt4 import QtGui # Filter design functions using a window diff --git a/gr-filter/python/filter/gui/banditems.py b/gr-filter/python/filter/gui/banditems.py index 9a6158fcfb..5071fe7b03 100644 --- a/gr-filter/python/filter/gui/banditems.py +++ b/gr-filter/python/filter/gui/banditems.py @@ -50,7 +50,7 @@ class filtermovlineItem(QtGui.QGraphicsObject): def boundingRect(self): return QtCore.QRectF(0,0,400,400) - #allow only vertical movement and emit signals + #allow only vertical movement and emit signals def itemChange(self, change, value): if (change == QtGui.QGraphicsItem.ItemPositionChange): newpos=value.toPointF() @@ -182,25 +182,25 @@ bnfItems=[] #lpfitems list lpfItems.append(filtermovlineItem(200,175,400,175,0,-60)) #lpfItems.append(filtermovlineItem(200,145,400,145,30,-30)) -lpfItems[0].setFlags(QtGui.QGraphicsItem.ItemIsSelectable | QtGui.QGraphicsItem.ItemIsMovable| +lpfItems[0].setFlags(QtGui.QGraphicsItem.ItemIsSelectable | QtGui.QGraphicsItem.ItemIsMovable| QtGui.QGraphicsItem.ItemSendsGeometryChanges) lpfItems.append(lpfsLines()) #hpfitems list hpfItems.append(filtermovlineItem(6,175,150,175,0,-60)) -hpfItems[0].setFlags(QtGui.QGraphicsItem.ItemIsSelectable | QtGui.QGraphicsItem.ItemIsMovable| +hpfItems[0].setFlags(QtGui.QGraphicsItem.ItemIsSelectable | QtGui.QGraphicsItem.ItemIsMovable| QtGui.QGraphicsItem.ItemSendsGeometryChanges) hpfItems.append(hpfsLines()) #bpfitems list bpfItems.append(filtermovlineItem(6,175,110,175,0,-60,True,300,175,400,175)) -bpfItems[0].setFlags(QtGui.QGraphicsItem.ItemIsSelectable | QtGui.QGraphicsItem.ItemIsMovable| +bpfItems[0].setFlags(QtGui.QGraphicsItem.ItemIsSelectable | QtGui.QGraphicsItem.ItemIsMovable| QtGui.QGraphicsItem.ItemSendsGeometryChanges) bpfItems.append(bpfsLines()) #bnfitems list bnfItems.append(filtermovlineItem(155,175,255,175,0,-60)) -bnfItems[0].setFlags(QtGui.QGraphicsItem.ItemIsSelectable | QtGui.QGraphicsItem.ItemIsMovable| +bnfItems[0].setFlags(QtGui.QGraphicsItem.ItemIsSelectable | QtGui.QGraphicsItem.ItemIsMovable| QtGui.QGraphicsItem.ItemSendsGeometryChanges) bnfItems.append(bnfsLines()) diff --git a/gr-filter/python/filter/gui/idealbanditems.py b/gr-filter/python/filter/gui/idealbanditems.py index b0c0497e38..ce556577eb 100644 --- a/gr-filter/python/filter/gui/idealbanditems.py +++ b/gr-filter/python/filter/gui/idealbanditems.py @@ -42,140 +42,140 @@ class IdealBandItems(): if (ftype == "Low Pass"): self.detach_unwantedcurves(plot) x=[0, self.params["pbend"]] - y=[20.0*scipy.log10(self.params["gain"])]*2 + y=[20.0*scipy.log10(self.params["gain"])]*2 self.idealbandhcurves[0].setData(x, y) - + x=[self.params["pbend"]]*2 y=[20.0*scipy.log10(self.params["gain"]), - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[0].setData(x, y) - + x=[self.params["sbstart"], self.params["fs"]/2.0] - y=[-self.params["atten"]]*2 + y=[-self.params["atten"]]*2 self.idealbandhcurves[1].setData(x, y) - + x=[self.params["sbstart"]]*2 - y=[-self.params["atten"], - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + y=[-self.params["atten"], + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[1].setData(x, y) elif ftype == "High Pass": self.detach_unwantedcurves(plot) x=[self.params["pbstart"],self.params["fs"]/2.0] - y=[20.0*scipy.log10(self.params["gain"])]*2 + y=[20.0*scipy.log10(self.params["gain"])]*2 self.idealbandhcurves[0].setData(x, y) - + x=[self.params["pbstart"]]*2 y=[20.0*scipy.log10(self.params["gain"]), - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[0].setData(x, y) - + x=[0,self.params["sbend"]] - y=[-self.params["atten"]]*2 + y=[-self.params["atten"]]*2 self.idealbandhcurves[1].setData(x, y) - + x=[self.params["sbend"]]*2 - y=[-self.params["atten"], - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + y=[-self.params["atten"], + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[1].setData(x, y) elif ftype == "Band Notch": x=[self.params["sbstart"],self.params["sbend"]] - y=[-self.params["atten"]]*2 + y=[-self.params["atten"]]*2 self.idealbandhcurves[0].setData(x, y) - + x=[self.params["sbstart"]]*2 - y=[-self.params["atten"], - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + y=[-self.params["atten"], + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[0].setData(x, y) - + x=[self.params["sbend"]]*2 - y=[-self.params["atten"], - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + y=[-self.params["atten"], + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[1].setData(x, y) x=[0,self.params["sbstart"]-self.params["tb"]] - y=[20.0*scipy.log10(self.params["gain"])]*2 + y=[20.0*scipy.log10(self.params["gain"])]*2 self.idealbandhcurves[1].setData(x, y) - + x=[self.params["sbstart"]-self.params["tb"]]*2 y=[20.0*scipy.log10(self.params["gain"]), - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[2].setData(x, y) x=[self.params["sbend"]+self.params["tb"],self.params["fs"]/2.0] - y=[20.0*scipy.log10(self.params["gain"])]*2 + y=[20.0*scipy.log10(self.params["gain"])]*2 self.idealbandhcurves[2].setData(x, y) - + x=[self.params["sbend"]+self.params["tb"]]*2 y=[20.0*scipy.log10(self.params["gain"]), - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[3].setData(x, y) elif ftype == "Band Pass": x=[self.params["pbstart"],self.params["pbend"]] - y=[20.0*scipy.log10(self.params["gain"])]*2 + y=[20.0*scipy.log10(self.params["gain"])]*2 self.idealbandhcurves[0].setData(x, y) - + x=[self.params["pbstart"]]*2 y=[20.0*scipy.log10(self.params["gain"]), - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[0].setData(x, y) - + x=[self.params["pbend"]]*2 y=[20.0*scipy.log10(self.params["gain"]), - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[1].setData(x, y) x=[0,self.params["pbstart"]-self.params["tb"]] - y=[-self.params["atten"]]*2 + y=[-self.params["atten"]]*2 self.idealbandhcurves[1].setData(x, y) - + x=[self.params["pbstart"]-self.params["tb"]]*2 - y=[-self.params["atten"], - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + y=[-self.params["atten"], + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[2].setData(x, y) x=[self.params["pbend"]+self.params["tb"],self.params["fs"]/2.0] - y=[-self.params["atten"]]*2 + y=[-self.params["atten"]]*2 self.idealbandhcurves[2].setData(x, y) - + x=[self.params["pbend"]+self.params["tb"]]*2 - y=[-self.params["atten"], - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + y=[-self.params["atten"], + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[3].setData(x, y) elif ftype == "Complex Band Pass": x=[self.params["pbstart"],self.params["pbend"]] - y=[20.0*scipy.log10(self.params["gain"])]*2 + y=[20.0*scipy.log10(self.params["gain"])]*2 self.idealbandhcurves[0].setData(x, y) - + x=[self.params["pbstart"]]*2 y=[20.0*scipy.log10(self.params["gain"]), - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[0].setData(x, y) - + x=[self.params["pbend"]]*2 y=[20.0*scipy.log10(self.params["gain"]), - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[1].setData(x, y) x=[0,self.params["pbstart"]-self.params["tb"]] - y=[-self.params["atten"]]*2 + y=[-self.params["atten"]]*2 self.idealbandhcurves[1].setData(x, y) - + x=[self.params["pbstart"]-self.params["tb"]]*2 - y=[-self.params["atten"], - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + y=[-self.params["atten"], + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[2].setData(x, y) x=[self.params["pbend"]+self.params["tb"],self.params["fs"]/2.0] - y=[-self.params["atten"]]*2 + y=[-self.params["atten"]]*2 self.idealbandhcurves[2].setData(x, y) - + x=[self.params["pbend"]+self.params["tb"]]*2 - y=[-self.params["atten"], - plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] + y=[-self.params["atten"], + plot.axisScaleDiv(Qwt.QwtPlot.yLeft).lowerBound()] self.idealbandvcurves[3].setData(x, y) else: self.detach_allidealcurves(plot) @@ -183,7 +183,7 @@ class IdealBandItems(): except KeyError: print "All parameters not set for ideal band diagram" self.detach_allidealcurves(plot) - + def detach_allidealcurves(self, plot): for c in self.idealbandhcurves: c.detach() diff --git a/gr-filter/python/filter/gui/polezero_plot.py b/gr-filter/python/filter/gui/polezero_plot.py index 0115339e5e..839af0400d 100644 --- a/gr-filter/python/filter/gui/polezero_plot.py +++ b/gr-filter/python/filter/gui/polezero_plot.py @@ -29,7 +29,7 @@ class PzPlot(Qwt.QwtPlot): def __init__(self, *args): Qwt.QwtPlot.__init__(self, *args) - + self.ymax=0 self.xmax=0 self.ymin=0 @@ -39,11 +39,11 @@ class PzPlot(Qwt.QwtPlot): grid = Qwt.QwtPlotGrid() grid.attach(self) grid.setMajPen(Qt.QPen(Qt.Qt.white, 0, Qt.Qt.DotLine)) - + self.setAxisScale(Qwt.QwtPlot.xBottom, -3, 3) self.setAxisScale(Qwt.QwtPlot.yLeft, -2, 2) self.drawUnitcircle() - + def setCanvasColor(self, color): @@ -52,7 +52,7 @@ class PzPlot(Qwt.QwtPlot): def drawUnitcircle(self): - radius = 1.0 + radius = 1.0 steps = 1024 angleStep = 2 * pi / steps @@ -97,7 +97,7 @@ class PzPlot(Qwt.QwtPlot): xmax = max(xmax,self.xmax) xmin = min(roots.real) xmin = min(xmin,self.xmin) - + #To make the plot look good if xmax <= 1.3: xmax = 2 @@ -165,23 +165,23 @@ class CanvasPicker(Qt.QObject): self.__selectedcPoint = -1 self.__addedZero = -1 self.__addedcZero = -1 - self.changeConjugate = False - self.enableZeroadd= False - self.enablePoleadd= False - self.enablepzDelete= False - self.iir = False + self.changeConjugate = False + self.enableZeroadd= False + self.enablePoleadd= False + self.enablepzDelete= False + self.iir = False self.__plot = plot canvas = plot.canvas() canvas.installEventFilter(self) - + # We want the focus, but no focus rect. # The selected point will be highlighted instead. canvas.setFocusPolicy(Qt.Qt.StrongFocus) canvas.setCursor(Qt.Qt.PointingHandCursor) canvas.setFocusIndicator(Qwt.QwtPlotCanvas.ItemFocusIndicator) canvas.setFocus() - + canvas.setWhatsThis( 'All points can be moved using the left mouse button ' 'or with these keys:\n\n' @@ -208,15 +208,15 @@ class CanvasPicker(Qt.QObject): def set_conjugate(self): self.changeConjugate = not(self.changeConjugate) - + def set_iir(self,val=True): - self.iir = val - + self.iir = val + def add_zero(self): self.enableZeroadd = not(self.enableZeroadd) def add_pole(self): - #Adding pole support only for iir + #Adding pole support only for iir if self.iir: self.enablePoleadd = not(self.enablePoleadd) @@ -224,12 +224,12 @@ class CanvasPicker(Qt.QObject): self.enablepzDelete = not(self.enablepzDelete) def eventFilter(self, object, event): - + if event.type() == Qt.QEvent.FocusIn: self.__showCursor(True) if event.type() == Qt.QEvent.FocusOut: self.__showCursor(False) - + if event.type() == Qt.QEvent.Paint: Qt.QApplication.postEvent( self, Qt.QEvent(Qt.QEvent.User)) @@ -286,13 +286,13 @@ class CanvasPicker(Qt.QObject): self.__moveBy(0, -delta) elif key == Qt.Qt.Key_9: self.__moveBy(delta, -delta) - + return Qwt.QwtPlot.eventFilter(self, object, event) def __select(self, pos): found, distance, point = None, 1e100, -1 - + for curve in self.__plot.itemList(): if isinstance(curve, Qwt.QwtPlotCurve): if curve.symbol().style() != Qwt.QwtSymbol.NoSymbol: @@ -310,7 +310,7 @@ class CanvasPicker(Qt.QObject): if found and distance < 10: self.__selectedCurve = found self.__selectedPoint = point - #search for conjugate point if enabled + #search for conjugate point if enabled if self.changeConjugate: j=self.__searchConjugate(found.x(point),found.y(point)) self.__selectedcPoint = j @@ -334,10 +334,10 @@ class CanvasPicker(Qt.QObject): xData=delete(xData, self.__selectedPoint) yData=delete(yData, self.__selectedPoint) #one less to accomodate previous delete - if(self.__selectedcPoint != -1): + if(self.__selectedcPoint != -1): xData=delete(xData, self.__selectedcPoint-1) yData=delete(yData, self.__selectedcPoint-1) - + curve.setData(xData, yData) self.__plot.replot() px=[] @@ -382,7 +382,7 @@ class CanvasPicker(Qt.QObject): if i == self.__selectedPoint: xData[i] = self.__plot.invTransform(curve.xAxis(), pos.x()) yData[i] = self.__plot.invTransform(curve.yAxis(), pos.y()) - if(self.__selectedcPoint != -1): + if(self.__selectedcPoint != -1): xData[self.__selectedcPoint] = xData[i] yData[self.__selectedcPoint] = -yData[i] elif i != self.__selectedcPoint: @@ -406,7 +406,7 @@ class CanvasPicker(Qt.QObject): if (round(curve.x(i),8) == round(x,8) and round(curve.y(i),8) == -round(y,8)): if (y !=0): return i - return -1 + return -1 def __drawAddedzero_pole(self, showIt, pos): editcurve='' @@ -436,7 +436,7 @@ class CanvasPicker(Qt.QObject): yData[i+1] = self.__plot.invTransform(editcurve.yAxis(), pos.y()) if self.changeConjugate: - xData[i+2] = xData[i+1] + xData[i+2] = xData[i+1] yData[i+2] = -yData[i+1] self.__addedcZero=i+2 @@ -489,7 +489,7 @@ class CanvasPicker(Qt.QObject): curve.setSymbol(symbol) self.__plot.setAutoReplot(doReplot) - + def __shiftCurveCursor(self, up): curves = [curve for curve in self.__plot.itemList() if isinstance(curve, Qwt.QwtPlotCurve)] diff --git a/gr-filter/python/filter/gui/pyqt_filter_stacked.ui b/gr-filter/python/filter/gui/pyqt_filter_stacked.ui index 7aecf62508..4d7336c8ca 100644 --- a/gr-filter/python/filter/gui/pyqt_filter_stacked.ui +++ b/gr-filter/python/filter/gui/pyqt_filter_stacked.ui @@ -2060,7 +2060,7 @@ <item row="2" column="0"> <widget class="QLabel" name="firhbtrEditLabel2"> <property name="text"> - <string>Transition width + <string>Transition width (from fs/4)</string> </property> </widget> diff --git a/gr-filter/python/filter/optfir.py b/gr-filter/python/filter/optfir.py index 47b0ac4e8d..8ef2a06732 100644 --- a/gr-filter/python/filter/optfir.py +++ b/gr-filter/python/filter/optfir.py @@ -36,7 +36,7 @@ def low_pass (gain, Fs, freq1, freq2, passband_ripple_db, stopband_atten_db, nextra_taps=2): """ Builds a low pass filter. - + Args: gain: Filter gain in the passband (linear) Fs: Sampling rate (sps) @@ -60,7 +60,7 @@ def band_pass (gain, Fs, freq_sb1, freq_pb1, freq_pb2, freq_sb2, nextra_taps=2): """ Builds a band pass filter. - + Args: gain: Filter gain in the passband (linear) Fs: Sampling rate (sps) @@ -89,7 +89,7 @@ def complex_band_pass (gain, Fs, freq_sb1, freq_pb1, freq_pb2, freq_sb2, """ Builds a band pass filter with complex taps by making an LPF and spinning it up to the right center frequency - + Args: gain: Filter gain in the passband (linear) Fs: Sampling rate (sps) @@ -117,7 +117,7 @@ def band_reject (gain, Fs, freq_pb1, freq_sb1, freq_sb2, freq_pb2, """ Builds a band reject filter spinning it up to the right center frequency - + Args: gain: Filter gain in the passband (linear) Fs: Sampling rate (sps) @@ -148,7 +148,7 @@ def high_pass (gain, Fs, freq1, freq2, passband_ripple_db, stopband_atten_db, nextra_taps=2): """ Builds a high pass filter. - + Args: gain: Filter gain in the passband (linear) Fs: Sampling rate (sps) diff --git a/gr-filter/python/filter/qa_fir_filter.py b/gr-filter/python/filter/qa_fir_filter.py index 9509ef8284..172d64a8dc 100755 --- a/gr-filter/python/filter/qa_fir_filter.py +++ b/gr-filter/python/filter/qa_fir_filter.py @@ -100,7 +100,7 @@ class test_filter(gr_unittest.TestCase): taps = 20*[0.5+1j, 0.5+1j] src_data = 40*[1+1j, 2+2j, 3+3j, 4+4j] expected_data = fir_filter(src_data, taps, decim) - + src = blocks.vector_source_c(src_data) op = filter.fir_filter_ccc(decim, taps) dst = blocks.vector_sink_c() @@ -115,7 +115,7 @@ class test_filter(gr_unittest.TestCase): taps = filter.firdes.low_pass(1, 1, 0.1, 0.01) src_data = 10*[1+1j, 2+2j, 3+3j, 4+4j] expected_data = fir_filter(src_data, taps, decim) - + src = blocks.vector_source_c(src_data) op = filter.fir_filter_ccc(decim, taps) dst = blocks.vector_sink_c() diff --git a/gr-filter/python/filter/qa_fractional_interpolator.py b/gr-filter/python/filter/qa_fractional_interpolator.py index 42d68886b8..839ff28d8b 100755 --- a/gr-filter/python/filter/qa_fractional_interpolator.py +++ b/gr-filter/python/filter/qa_fractional_interpolator.py @@ -55,7 +55,7 @@ class test_fractional_resampler(gr_unittest.TestCase): snk = blocks.vector_sink_f() self.tb.connect(signal, op, snk) - self.tb.run() + self.tb.run() Ntest = 5000 L = len(snk.data()) @@ -81,7 +81,7 @@ class test_fractional_resampler(gr_unittest.TestCase): snk = blocks.vector_sink_c() self.tb.connect(signal, op, snk) - self.tb.run() + self.tb.run() Ntest = 5000 L = len(snk.data()) diff --git a/gr-filter/python/filter/qa_fractional_resampler.py b/gr-filter/python/filter/qa_fractional_resampler.py index ea01cf7eef..2580b8dd16 100644 --- a/gr-filter/python/filter/qa_fractional_resampler.py +++ b/gr-filter/python/filter/qa_fractional_resampler.py @@ -59,7 +59,7 @@ class test_fractional_resampler(gr_unittest.TestCase): snk = blocks.vector_sink_f() self.tb.connect(signal, op, snk) - self.tb.run() + self.tb.run() Ntest = 5000 L = len(snk.data()) @@ -84,7 +84,7 @@ class test_fractional_resampler(gr_unittest.TestCase): snk = blocks.vector_sink_c() self.tb.connect(signal, op, snk) - self.tb.run() + self.tb.run() Ntest = 5000 L = len(snk.data()) @@ -113,7 +113,7 @@ class test_fractional_resampler(gr_unittest.TestCase): self.tb.connect(signal, op, snk) self.tb.connect(control, (op,1)) - self.tb.run() + self.tb.run() Ntest = 5000 L = len(snk.data()) @@ -141,7 +141,7 @@ class test_fractional_resampler(gr_unittest.TestCase): self.tb.connect(signal, op, snk) self.tb.connect(control, (op,1)) - self.tb.run() + self.tb.run() Ntest = 5000 L = len(snk.data()) diff --git a/gr-filter/python/filter/qa_hilbert.py b/gr-filter/python/filter/qa_hilbert.py index 96901bf819..e8550a5932 100755 --- a/gr-filter/python/filter/qa_hilbert.py +++ b/gr-filter/python/filter/qa_hilbert.py @@ -51,7 +51,7 @@ class test_hilbert(gr_unittest.TestCase): tb = self.tb ntaps = 51 sampling_freq = 100 - + N = int(ntaps + sampling_freq * 0.10) data = sig_source_f(sampling_freq, sampling_freq * 0.10, 1.0, N) src1 = blocks.vector_source_f(data) |