Discussion:
[Hackrf-dev] How to resend SDRSharp captured baseband iq data
kkkk
2017-03-28 15:19:27 UTC
Permalink
I have set of data which I have captured  in the past using RTL-2832 usb devices and SDRSharp software under Windows. Now i would like to resend these data using the HackRF One and hackrf_resend command under linux. The function hackrf_transfer, both tx and rx under linux is working. However I would like to use this old captured data. I cannot record it again. That would be the easiest way. The data from SDR Sharp are 8 bit baseband IQ samples with wav extension. If I understand correct the data are in different format. SDRSharp saved it as 8 bit unsigned whereas hackrf_transfer is using 8 bit signed and without wav header. The switch '-w' is helping when we would like to reopen hackrf captured data in SDRSharp, but i need to do this in other way. From Sdrsharp to hackrf one. I have GNU Radio companion and trying to do some conversion. In this way SourceFile>>adding -127constant>>SinkFile. But something is missing. What kind of operation should I perform in GNURadio Companion between the source and sink file blocks?
Michael Ossmann
2017-03-28 19:33:51 UTC
Permalink
I have set of data which I have captured  in the past using RTL-2832 usb
devices and SDRSharp software under Windows.
...
What kind of operation should I perform in GNURadio Companion
between the source and sink file blocks?
It depends on the type of source block used. I recommend using sox instead:

sox source.wav destination.u8

Michael
kkkk
2017-03-28 21:19:55 UTC
Permalink
I have performed the sox command that works but to till the end. It just cut from the original SDRSharp wav file the first 22bytes. I guess this is e header. And the rest data are exact the same. So I performed again that command as "sox sdriq.wav destination.s8". And now is fine  my ding dong bell is talking :) I am very happy because that worked and secondly I have learned sox command. I have not knew about it. But Michael regarding to the GNU radio, what should be the  right conversion way in GRC, after cutting wav header, or maybe there is a block which cuts the header?. I have a file source block and the file sink block. I have read several posts, and as far as I know the difference between singed and unsigned 8 bit format is that the MSBit has a weight of -127. Its all about this offset. But how to perform that, should I split first the data and then shift the RE and Im samples about value of 127 as they did here 2.bp.blogspot.com 2.bp.blogspot.com Or as You are did here without splitting greatscottgadgets.com greatscottgadgets.com I do not understand whats the difference, maybe two ways are ok, and I am mixed up to much :) Regards
Michael Ossmann
2017-03-28 22:22:11 UTC
Permalink
Post by kkkk
performed again that command as "sox sdriq.wav
destination.s8". And now is fine  my ding dong bell is talking :)
Excellent, and good catch! I should have told you to use .s8 instead of
.u8, but I had .u8 on my mind because I've been working with unsigned
infrared captures lately.
Post by kkkk
But Michael regarding to the GNU radio, what should be the  right
conversion way in GRC, after cutting wav header, or maybe there is a
block which cuts the header?.
I recommend using the Wav File Source. It strips the header and
converts to float. Then you can use Float to Char with a scale of 128
leading to a File Sink.

If you want to do something with the data in GNU Radio Companion other
than just dumping to a file, configure the Wav File Source to have 2
channels, and connect its two outputs to Float to Complex.

Michael

Loading...