Bug fixes #1

Merged
thomas merged 2 commits from rudi_s into libhackrf 2024-04-20 01:24:13 +02:00
3 changed files with 4 additions and 3 deletions

View file

@ -106,6 +106,7 @@ int main(int argc, char **argv)
firdecim_crcf decim = firdecim_crcf_create_kaiser(SDR_OVERSAMPLING, 9, 60.0f);
nco_crcf rx_nco = nco_crcf_create(LIQUID_NCO);
nco_crcf_set_frequency(rx_nco, 2 * 3.14159 * SDR_RX_IF_SHIFT / SDR_RX_SAMPLING_RATE);
inputfile = fopen(argv[1], "rb");
if(!inputfile) {

View file

@ -14,7 +14,7 @@ def load_data():
print(f"Error: not a complex signal file. Format {header} not implemented yet.")
exit(1)
T = np.fromfile(infile, dtype=np.float32, count=1)
T = np.fromfile(infile, dtype=np.float32, count=1)[0]
data = np.fromfile(infile, dtype=np.complex64)
f = np.arange(-1/(2*T), 1/(2*T), 1/T/data.size)[:data.size]

View file

@ -8,10 +8,10 @@ import matplotlib.pyplot as pp
with open(sys.argv[1], 'rb') as infile:
header = infile.read(4)
if header == b'CPX_':
T = np.fromfile(infile, dtype=np.float32, count=1)
T = np.fromfile(infile, dtype=np.float32, count=1)[0]
data = np.fromfile(infile, dtype=np.complex64)
elif header == b'FLT_':
T = np.fromfile(infile, dtype=np.float32, count=1)
T = np.fromfile(infile, dtype=np.float32, count=1)[0]
data = np.fromfile(infile, dtype=np.float32)
else:
print(f"Error: Format {header} not implemented yet.")