RF Analyzer Android app can record IQ (HackRF) files. SDR# cannot load IQ files stored with RF Analyzer. I found this Python script but it does not work in Python 3 (3.6.6) https://github.com/demantz/RFAnalyzer/blob/master/tools/prepWAV.py
Struct.error: argument for 's' must be a bytes object
I modified def writeWavHeader a bit and now SDR# can load those IQ files
def writeWavHeader(file, datasize, samplerate):
file.write(struct.pack('4s', bytes("RIFF", 'utf-8')))
file.write(struct.pack('I', datasize+36))
file.write(struct.pack('4s', bytes("WAVE", 'utf-8')))
file.write(struct.pack('4s', bytes("fmt ", 'utf-8')))
file.write(struct.pack('I', 16))
file.write(struct.pack('H', 1))
file.write(struct.pack('H', 2))
file.write(struct.pack('I', samplerate))
file.write(struct.pack('I', samplerate*2))
file.write(struct.pack('H', 2))
file.write(struct.pack('H', 8))
file.write(struct.pack('4s', bytes("data", 'utf-8')))
file.write(struct.pack('I', datasize))
I tested old RF Analyzer app in Nokia 6.2 (Android 10) and it seems to work ok.
Kommentit
Tämän blogin kommentit tarkistetaan ennen julkaisua.