3 # Copyright 2010 Free Software Foundation, Inc.
5 # This file is part of GNU Radio
7 # GNU Radio is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3, or (at your option)
12 # GNU Radio is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Radio; see the file COPYING. If not, write to
19 # the Free Software Foundation, Inc., 51 Franklin Street,
20 # Boston, MA 02110-1301, USA.
23 from gnuradio import gr, blks2
30 freqs = [100, 200, 300, 400, 500]
35 s = gr.sig_source_c(fs, gr.GR_SIN_WAVE, fi, 1)
38 taps = gr.firdes.low_pass_2(len(freqs), fs, fs/float(nchans)/2, 100, 100)
39 print "Num. Taps = %d (taps per filter = %d)" % (len(taps),
41 filtbank = gr.pfb_synthesis_filterbank_ccf(nchans, taps)
43 head = gr.head(gr.sizeof_gr_complex, N)
44 snk = gr.vector_sink_c()
47 tb.connect(filtbank, head, snk)
49 for i,si in enumerate(sigs):
50 tb.connect(si, (filtbank, i))
56 s1 = f1.add_subplot(1,1,1)
57 s1.plot(snk.data()[1000:])
61 s2 = f2.add_subplot(1,1,1)
62 winfunc = scipy.blackman
63 s2.psd(snk.data()[10000:], NFFT=fftlen,
66 window = lambda d: d*winfunc(fftlen))
70 if __name__ == "__main__":