Loading file into memory

Dear Gnuradio List,

I’m doing some benchmarking involving read a WAV file into my gnuradio
program, executing a APT Decoder, and writing out the result to a file.
I’m finding that my results are all I/O bound. I want to be able to load
the entire file into memory (load the WAV file into a vector or other
datatype) and then execute it, but still preserve the sampling rate. Is
there a way of doing that?

Sincerely,
Tommy T. II
UVA Grad Student

On Wed, Oct 31, 2012 at 10:32 AM, Tommy T. II [email protected]
wrote:

Dear Gnuradio List,

    I'm doing some benchmarking involving read a WAV file into my gnuradio 

program, executing a APT Decoder, and writing out the result to a file. I’m
finding that my results are all I/O bound. I want to be able to load the entire
file into memory (load the WAV file into a vector or other datatype) and then
execute it, but still preserve the sampling rate. Is there a way of doing that?

Sincerely,
Tommy T. II
UVA Grad Student

Tommy,

You could probably just use Python (possibly using Scipy’s fromfile
function) to read in the samples into an array and send that to a
vector_source_f. That’s not really ideal since we don’t condone the
use of vector_source/sink blocks for real applications, but if you
have the memory, this might be ok. You’ll find a large latency at the
start as you are reading the file and then inserting it into the
vector source.

Another approach would be to make a RAM disk and put the WAV file
there, then just read it in like normal.

Tom

Discuss-gnuradio Info Page

What sample rate are you using that is causing issues processing a WAV
file for APT? APT is relatively-speaking narrowband, so there’s
no way on gods little green earth that you’ll be exceeding the read
rate of your local disk for APT. If things are stalling, you’re doing
something wrong inside the flow-graph.


Marcus L.
Principal Investigator
Shirleys Bay Radio Astronomy Consortium