[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Plumbing questions

From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Plumbing questions
Date: Sat, 7 Jan 2006 00:03:39 -0800
User-agent: Mutt/1.5.6i

On Fri, Jan 06, 2006 at 04:17:03PM -0500, Marcus Leech wrote:
> 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.

This is initializing the superclass.  The last two args correspond to
the head and tail of the hierarchical block that we're defining.
[FWIW, this will probably get refactored over the next couple of
months.  There are some things that it would be nice to do that this
won't support.]

> 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)  ???

Just leave it as is.  Should work fine.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]