[Top][All Lists]

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

Re: [Discuss-gnuradio] Capture first 512 data samples every second

From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Capture first 512 data samples every second
Date: Thu, 16 Mar 2006 12:20:40 -0800
User-agent: Mutt/1.5.9i

On Thu, Mar 16, 2006 at 02:58:42PM -0500, sunflower wrote:
> Hi, Can anybody help me if I want to capture the first 512 data samples
> every second? I want to display data samples using GUI scope_sink as well.
> I try to used gr.head(). But I don't know how to put gr.run() into
> _build_gui() casue it is using stdgui.stdapp instead of build_graph()

One way to get what you want (that doesn't require any new code) is to

  item_size = gr.sizeof_foo
  N = sample_rate // 512                # assumes 512 divides sample_rate
  s2v = gr.stream_to_vector(item_size, 512)
  k = gr.keep_one_in_n(item_size, N)
  v2s = gr.vector_to_stream(item_size, 512)

  fg.connect(s2v, k, v2s)

Note, stream_to_vector and vector_to_stream are currently documented
as serial_to_parallel and parallel_to_serial.

> here is my code:

FYI, your mailer mangled the code.
Please don't post HTML to the list.


reply via email to

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