[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Sample size and data rates
From: |
George Nychis |
Subject: |
Re: [Discuss-gnuradio] Sample size and data rates |
Date: |
Wed, 05 Dec 2007 16:45:10 -0500 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20071022) |
1) 1 000 000 samples writes a file 8 000 000 bytes (7.6Mb)
This suggests each sample is 8bytes; 4bytes I and 4bytes Q.
Is my assumption correct?
This is how complex samples are represented in GNU Radio, as gr_complex
which is of type std::complex where I and Q are 4 bytes each, yes.
Considering that the ADC produces 12bit samples, I would expect that
each I and Q sample pair would be 4bytes. 2bytes I and 2bytes Q.
Please can someone advise where i've missed some understanding.
When the samples are generated in the USRP, they are packed (by default)
as 32-bit pairs, 16-bits for I and 16-bits for Q. This reduces the
amount of data across the bus rather than use full 32 bits for each.
You can set the format register to transfer 8-bit samples though.
Once these samples hit the host, GNU Radio extracts the samples in
whatever format they are and stores them as gr_complex. This simplifies
processing and makes everything standard. It also takes care of byte
ordering issues for you.
2) With reference to the above question, where can I find further
details regarding the function of the gr.sizeof_item identifiers, in
particular gr.sizeof_gr_complex.
What I do is find where the types are defined, i.e.:
gnuradio-core/src/lib/runtime/gr_complex.h
typedef std::complex<float> gr_complex;
- George