Trim large IQ files to just the packet of interest

From this interesting tweet: https://twitter.com/EU1SAT/status/1182491661328367616
Luojia 1-01 Beacon once every 6 minutes I was able to record it passing and wanted to save JUST the one burst plus maybe +/- 20 seconds, not the entire 1.4GB IQ file! So how to cut IQ stream?

the file is size in bytes: ls -l
1500315648 luojia_iq_fc.raw

number of 8 byte float/complex samples:
echo ‘1500315648 / 8’ |bc
187539456

at 288k samples per second that should be 10:51 as shown in gqrx or 10*60+51 = 651 seconds
$ echo ‘1500315648 / 8 / 288000’ |bc
651 <-- spot on!!

so to skip ahead 3:50 or 3*60+50 = 230 seconds, skip
$ echo ‘230 * 288000’ |bc
66240000 number of 8 byte float/complex pair samples to skip

and we want 20 seconds of 8 bytes samples or
$ echo ‘20 * 288000’ |bc
2304000 number of 8 byte float/complex pair samples to keep

Do the trim with input block size 8:
$ dd if=luojia_iq_fc.raw ibs=8 skip=66240000 count=5760000 of=luojia_iq_fc_trim2.raw
5760000+0 records in
90000+0 records out
46080000 bytes (46 MB, 44 MiB) copied, 6.07172 s, 7.6 MB/s

Test in gqrx worked. Now only have 44MiB to archive.

5 Likes