F5OEO / rpitx

RF transmitter for Raspberry Pi
GNU General Public License v3.0
4.01k stars 528 forks source link

How to reduce IQ files size, remove dead time? #167

Open dachshund-digital opened 5 years ago

dachshund-digital commented 5 years ago

How to reduce IQ files size, remove dead time? I am able to record and save IQ files no problem but I end up with an 8 second file, that really only needs to be 1.5 seconds long, so there is a lot of dead time at the beginning and ending of the IQ files of captured RF remote signals. With raw import to Audacity I can see the dead time, but there does not appear to be any easy way to save back to the IQ format? And since piam depreciated, not sure how I could convert a wav file to an IQ file correctly?

cdeletre commented 5 years ago

Hi you can easily identify timing in IQ file with inspectrum and then use smart dd command to cut it. Here is a hint:

input='your-file.raw' output='your-file-cut.raw' sr=2400000 # the sampling rate (replace with yours) su=16 # the sample unit size (here 2 x float32 for gqrx raw file, cs32 ....) start=2000 # in ms end=3500 # in ms bs=`expr $sr \* $su` bs=`expr $sr / 1000 ` # because we want to use millisecond precision (take care if you sampling rate is not a multiple of 1000) tcount=`expr $tend - $tstart` dd bs=$bs skip=$tstart count=$tcount if="$input" of="$output"

You can build a smart bash script that handle this for you. I'm working on it and may publish it in my github. While, I hope my comment here will help you.

Oh you may also decimate the IQ file, when recording with gqrx (see decimation option in device window) or after with gnuradio for example.