[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] Plumbing questions
From: |
Marcus Leech |
Subject: |
[Discuss-gnuradio] Plumbing questions |
Date: |
Fri, 06 Jan 2006 16:17:03 -0500 |
User-agent: |
Mozilla Thunderbird 1.0 (X11/20041206) |
I'm trying to morph wxgui/fftsink.py into a "strip chart" type sink for
RA use.
I have most of the logic implemented (at least for a first experimental
pass).
But I have questions about the appropriate plumbing. I'm going to
assume that
the sink will be available only in float, with essentially no
processing of the
incoming data stream other than displaying it appropriately.
The following piece of "plumbing" from class fft_sink_f in fftsink.py
confuses me:
s2p = gr.serial_to_parallel(gr.sizeof_float, fft_size)
one_in_n = gr.keep_one_in_n(gr.sizeof_float * fft_size,
max(1,
int(sample_rate/fft_size/fft_rate)))
fft = gr.fft_vfc(fft_size, True, True)
c2mag = gr.complex_to_mag(fft_size)
self.avg = gr.single_pole_iir_filter_ff(1.0, fft_size)
log = gr.nlog10_ff(20, fft_size, -20*math.log10(fft_size))
sink = gr.message_sink(gr.sizeof_float * fft_size, self.msgq, True)
fg.connect (s2p, one_in_n, fft, c2mag, self.avg, log, sink)
gr.hier_block.__init__(self, fg, s2p, sink)
Functionally, I understand what it's doing, but I don't know what
gr.hier_block.__init__(self,fg,s2p,sink) is
all about. I think that for my purposes, all I need to do is to
lash-in a gr.message_sink to pass data events
to the plotting routine. That's the very last item in the fftsink
chain--the gr.message_sink.
I think all I need to do instead of the above is:
sink = gr.message_sink(gr.sizeof_float * 1, self.msgq, True)
fg.connect(sink)
But what do I do with gr.hier_block.__init__(self, fg, s2p, sink) ???
- [Discuss-gnuradio] Plumbing questions,
Marcus Leech <=