[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] File formats, some header data per frame
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] File formats, some header data per frame |
Date: |
Fri, 1 Apr 2005 12:23:55 -0800 |
User-agent: |
Mutt/1.5.6i |
On Fri, Apr 01, 2005 at 02:06:53PM -0500, James Cooley wrote:
> Hi all,
>
> There was some talk a few weeks back on creating a file format in which
> there's a header storing info like the sample rate, capture freq,
> decimation, etc.
>
> I would like to create such a file, but would like to store some small
> amount of data once per work cycle. The idea is to constantly record a
> changing freq and other data and be able to play it back later.
>
> I followed the model of file_sink/file_source and designed format like
> this:
>
> <int> length of header stuff (could be 0)
> <int> header ints
> .... The sample data
>
> <int> length of header stuff (could be 0)
> <int> header ints
> .... The sample data
>
> <int> length of header stuff (could be 0)
> <int> header ints
> .... The sample data
>
> So far this doesn't work because of my assumption of the sample data
> size. Am I assuming correctly that sample data (n_input_items) items is
> a fixed size?
No. Not a safe assumption. The only thing your work routine can
count on is that it will be called with noutput_items = k * output_multiple()
for some integer k.
> How is that determined in the flow graph?
It's an implementation detail that is subject to change depending on
the implementation of the scheduler.
> Will it be the same when I go back to read in the file? (I think
> not, this is why my code fails, it assumes that it will find my
> header info (size, header) at the start of each work cycle when
> reading in the file).
Unlikely ;-)
I think you can get what you want by including the length of each
chunk of data in the file.
> <int> length of header stuff (could be 0)
> <int> header ints
> <int> number of samples in this chunk
> .... The sample data
> <int> length of header stuff (could be 0)
> <int> header ints
> <int> number of samples in this chunk
> .... The sample data
Eric