Cheers, and thanks for finding the error. Also, you should note that the USRP 
scales fc32 format to +\- 1, but the sc16 format is ADC levels. gr_fileman 
doesn't scale during the conversion, so .sc16 converted to .fc32 will be scaled 
differently than straight out of the USRP.

Paul Garver

On Dec 1, 2016, at 2:08 PM, AndroidT Tester 
<<>> wrote:

Hello Paul,

Indeed it's working now :) I successfully converted my 16-bit IQ sample file to 
a Cfile :) Thanks for all your help!!

On Thu, Dec 1, 2016 at 4:04 PM, Garver, Paul W 
<<>> wrote:
I think you found an error in gr_mkheader! In truth, it isn’t particularly well 
tested so I’m glad you are using it. I just pushed a commit to fix this to 
github. git pull the changes, rebuild, and try again. Let me know if it solves 
the issue for you.


On Dec 1, 2016, at 11:46 AM, AndroidT Tester 
<<>> wrote:

Thank you once again Paul.

ls -la
drwx------ 1 Username Username       4096 Dec  1 13:40 .
drwx------ 1 Username Username      12288 Nov 30 16:21 ..
-rwx------ 1 Username Username 7683964928 Nov 20 18:23 Sample-408MHz

gr_mkheader -r 1.8e6 -t sc16 -f 408e6 -l 1920991232 Sample-408MHz

Now I have Sample-408MHz.hdr:
gr_read_file_metadata Sample-408MHz.hdr -D
Version Number: 0
Sample Rate: 1800000.00 sps
Seconds: 0.000000
Item size: 4
Data Type: short (1)


Now when I do

gr_fileman Sample-408MHz Sample.cfile -o fc32

I get
Empty Header, quitting.

On Thu, Dec 1, 2016 at 1:35 PM, Garver, Paul W 
<<>> wrote:
It probably can’t find the header. The command

# gr_mkheader -r 1.8e6 -t sc16 -f 408e6 -l 1920991232 Sample-408MHz

should produce the file "Sample-408MHz.hdr"

Check that the file Sample-408MHz.hdr is produced. You can read it with

# gr_read_file_metadata Sample-408MHz.hdr -D


# gr_fileman Sample-408MHz Sample-408MHz.cfile -o fc32

Sample-408MHz should be the raw data, and Sample-408MHz.hdr the metadata 
produced with gr_mkheader.  This should produce
Sample-408MHz.cfile and Sample-408MHz.cfile.hdr.

On your copied command it appears you didn’t add the -o fc32 to specify you 
want a file type conversion.


On Dec 1, 2016, at 11:20 AM, AndroidT Tester 
<<>> wrote:

Thank you Paul,

I got this;
Empty Header, quitting.

I followed all your instructions and double checked all parameters. I did 
filesize / 4 for sample count.
I did this first:

gr_mkheader -r 1.8e6 -t sc16 -f 408e6 -l 1920991232 Sample-408MHz

Then when I try to do:

gr_fileman Sample-408MHz Sample.cfile

I got the error above, what am I missing?

On Thu, Dec 1, 2016 at 12:07 PM, Garver, Paul W 
<<>> wrote:
There are two different metadata types:
1) Inline
2) Detached

Here, you are using the detached headers. With detached, the raw samples are in 
a file, say myfile.sc16, and the metadata in myfile.sc16.hdr. See [1] for more 
information on GNURadio metadata.
So suppose you have myfile.sc16 as your raw sample file. Then you generate 
headers for it, since you didn’t record it with any. You also need to give 
gr_mkheader -l num_samps so it knows how long the file is. For sc16 you just do 
file_size_bytes/4 to get # of samples in a file.

# gr_mkheader -r 1.8e6 -t sc16 -f 408e6 myfile.sc16

This generates the file: myfile.sc16.hdr containing the file type, center 
frequency, sample rate, etc. This is simply my convention, but the metadata is 
“linked” to the raw samples by the filename
raw data: myfile.sc16, where sc16 specifies the file format.
metadata: myfile.sc16.hdr

Then, you can give this to gr_fileman to convert the type:

# gr_fileman myfile.sc16 myfile.fc32 -o fc32

gr_fileman looks for filename.hdr for the detached header info. So in this 
case, it files myfile.sc16.hdr, and should happily convert for you.



On Dec 1, 2016, at 9:45 AM, AndroidT Tester 
<<>> wrote:

Thank you Paul, I never heard of gr-analysis before.
So I tried this:

gr_mkheader -r 1.8e6 -t sc16 -f 408e6 myheader

This only created myheader.hdr file. How can I link this to my actual recording 
sample which is 16-bit IQ pair and then convert it to CFile?
Do I concatenate the files? put myheader.hdr at top of my recording?
Sorry again for these newbie questions

On Thu, Dec 1, 2016 at 11:32 AM, Garver, Paul W 
<<>> wrote:
Please copy the list next time so other folks can respond besides me.

Just attach a file sink to the ishort to complex block. There’s also a 
command-line tool called gr_fileman in gr-analysis [1] which will do this, but 
the file needs headers. If you don’t have them, you can generate with 
gr_mkheader in gr-analysis.


Hope this helps,

On Dec 1, 2016, at 9:22 AM, AndroidT Tester 
<<>> wrote:

Now, how can I convert this to a CFILE format where I can play it in Gqrx? 
Thank you

On Wed, Nov 30, 2016 at 11:34 AM, AndroidT Tester 
<<>> wrote:
Thank you very much! It worked :)

On Wed, Nov 30, 2016 at 11:04 AM, Garver, Paul W 
<<>> wrote:
Use a file source block with “short” type into an “Ishort to Complex” block. 
The Ishort to Complex block will de-interleave the shorts into complex samples.

> On Nov 30, 2016, at 8:55 AM, AndroidT Tester 
> <<>> wrote:
> Hey guys,
> I have a sample file with IQ pairs, each I and Q is 16-bits, I want to load 
> this in GNURadio companion using File source sink, but I'm not sure how can I 
> specify 16-bit format for I and 16-bit for Q in Gnuradio companion and then 
> connect it to lets say FFT or Waterfall widget. Can someone advise a bit?
> Thank you!
> _______________________________________________
> Discuss-gnuradio mailing list

Discuss-gnuradio mailing list

Reply via email to