discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] question on using gr.file_source


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] question on using gr.file_source
Date: Mon, 14 Jan 2008 11:05:13 +0000
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Jason Anders wrote:
I have a problem. Let's say that Rx1 stores the output of a gr.file_source() operation. I want to extract its contents so that I could access it as an array. You said that I use gr.vector_sink(). However, gr.vector_sink () doesn't take any input arguments.... =(


So basically, how would it know that I want to extract values from the Rx1 stream when I have other input streams?

Thanks!

On Jan 13, 2008 9:58 PM, Martin Braun < address@hidden <mailto:address@hidden>> wrote:

    On Sunday 13 January 2008 13:15:54 Jason Anders wrote:
    > Hi! I', quite new to GNU Radio and I was wondering whether I could
    > access via index the values obtained after the gr.file_source ()
    > command?
    >
    > I mean, could I retrieve contents just as if it were an array?
    Thanks!

    You can send it to a gr.vector_sink_* and then get an array using
    data().

    Martin


Jason,

As Martin said, you need to get the array using data = <vector_sink object>.data()

To do this, you want to stop the flow graph. In the case of using a file source, just run the contents of the file through once and the flowgraph will terminate after an 'fg.wait()'. Then, call the data accessor function of the vector sink, which returns a list. You can then access the items of the list like you want.

Tom





reply via email to

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