Posts

Showing posts with the label I/Q

Convert RF Analyzer IQ files to SDR# wav

4.8.2020 Convert RF Analyzer IQ files to SDR# wav 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(...

CC1120 - channel filter I/Q data

Image
8.11.2020 CC1120 - channel filter I/Q data CC1120 + MikroElektronika ccRF3 click board Arduino Due I/Q data after channel filter is 19-bit, datasheet does not state if it is in 2's complement format. Assuming format is 2's complement. Changed transparent serial mode to synchronous serial mode, more convenient serial print for further processing in Python and fixed decimal conversion bug in Arduino code.   Python code (Due connected to COM4). Assuming CC1120 channel filter I/Q data sample rate is 4x channel filter bandwidth (12500 Hz x 4) import serial import numpy as np import matplotlib.pyplot as plt count = 0 sd = [] with serial.Serial('COM4', 115200, timeout=1) as ser:     print(ser.name)     line = ser.readline().decode('utf-8').replace("\r\n", "")     while line != "EOF":         if line != "":             sd.append(line)    ...