Forum: GNU Radio Loading file into memory

Posted by Tommy Tracy II (Guest)
on 2012-10-31 15:33
(Received via mailing list)
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 Tracy II
  UVA Grad Student
Posted by Tom Rondeau (Guest)
on 2012-10-31 22:35
(Received via mailing list)
On Wed, Oct 31, 2012 at 10:32 AM, Tommy Tracy II <tjt7a@virginia.edu> 
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 Tracy 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
Posted by Marcus D. Leech (Guest)
on 2012-10-31 22:40
(Received via mailing list)
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
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 Leech
Principal Investigator
Shirleys Bay Radio Astronomy Consortium
http://www.sbrac.org
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.