X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnuradio-examples%2Fpython%2Fpfb%2Fsynth_filter.py;h=a1562f9eacb05103f5aad1ba706e78c9e591aa6f;hb=80b84262f6fba7da08d888e73e8cb0e981a3a065;hp=015ebd66845119575b94facc6680249fac8e391a;hpb=62042813aeeffeeb6091e229761c5068b5ed5cde;p=debian%2Fgnuradio diff --git a/gnuradio-examples/python/pfb/synth_filter.py b/gnuradio-examples/python/pfb/synth_filter.py index 015ebd66..a1562f9e 100755 --- a/gnuradio-examples/python/pfb/synth_filter.py +++ b/gnuradio-examples/python/pfb/synth_filter.py @@ -1,4 +1,24 @@ #!/usr/bin/env python +# +# Copyright 2010 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, +# Boston, MA 02110-1301, USA. +# from gnuradio import gr, blks2 import scipy, pylab @@ -11,17 +31,13 @@ def main(): nchans = 7 sigs = list() - fmtx = list() for fi in freqs: s = gr.sig_source_c(fs, gr.GR_SIN_WAVE, fi, 1) - fm = blks2.nbfm_tx (fs, 4*fs, max_dev=10000, tau=75e-6) sigs.append(s) - fmtx.append(fm) taps = gr.firdes.low_pass_2(len(freqs), fs, fs/float(nchans)/2, 100, 100) print "Num. Taps = %d (taps per filter = %d)" % (len(taps), len(taps)/nchans) - #filtbank = blks2.synthesis_filterbank(nchans, taps) filtbank = gr.pfb_synthesis_filterbank_ccf(nchans, taps) head = gr.head(gr.sizeof_gr_complex, N) @@ -31,12 +47,11 @@ def main(): tb.connect(filtbank, head, snk) for i,si in enumerate(sigs): - #tb.connect(si, fmtx[i], (filtbank, i)) tb.connect(si, (filtbank, i)) tb.run() - if 0: + if 1: f1 = pylab.figure(1) s1 = f1.add_subplot(1,1,1) s1.plot(snk.data()[1000:]) @@ -45,7 +60,6 @@ def main(): f2 = pylab.figure(2) s2 = f2.add_subplot(1,1,1) winfunc = scipy.blackman - #winfunc = scipy.hamming s2.psd(snk.data()[10000:], NFFT=fftlen, Fs = nchans*fs, noverlap=fftlen/4,