[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Question: How to read file contents
From: |
George Nychis |
Subject: |
Re: [Discuss-gnuradio] Question: How to read file contents |
Date: |
Mon, 28 Jan 2008 21:22:07 -0500 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20071022) |
Hi Jason,
Jason Anders wrote:
Hi!
Since no one has responded to my post regarding my problem on reading a
file. I will post another message regarding this. But instead, I'll ask
a very basic question.
I think it's because your post is a little unclear.
When you say "I have a problem reading an ascii file" ...is it binary
float data? Is it string representation of numbers? It makes a big
difference. When you say "ascii" I interpret this as "12.5" in text
format which is not what gr.file_source is going to parse.
How do you read contents from a file using GNU Radio blocks? I always
get an empty list when I try to run the code that I posted here like 5
days ago......
It all depends what is in this file, as I stated before. Your code is
attempting to read a binary file of floats:
yrx1_real = gr.file_source(gr.sizeof_float,{file location},FALSE)
is it really a binary file of floats? or is it:
12.7
234.5
... etc
Aside from that, you never actually start your flow graph. I've never
used wait(), but I'm pretty sure you still need to fg.start() ...
otherwise it never starts and you never ever get data in what you're
trying to read. It's always going to be whatever it's initialized as.
P.S.
I really wish GNU Radio has a better user manual just like MATLAB. I
mean, I posted a very basic question and I'm expecting answers by now.
GNU Radio is open source, unlike MATLAB. That means you literally have
everything documented in code. If you're not sure how a block works,
you just look at the code. Search the mailing list for some of Firas'
posts about the documentation he is generating. Here's a small guide I
found from google:
http://www.nd.edu/~jnl/sdr/docs/tutorials/9.html
The code always evolves, it's hard to keep manuals up to date, which is
why the code itself is usually the best documentation :)
- George