From 79fc1c4f59e0f32ce487d5f6b0a8e9ea718e7390 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 20 Apr 2024 01:09:03 +0200 Subject: [PATCH 1/2] utils: fix numpy deprecation warnings --- impl/utils/plot_spectrum_loop.py | 2 +- impl/utils/plot_timedomain.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/impl/utils/plot_spectrum_loop.py b/impl/utils/plot_spectrum_loop.py index aba9ff4..ebb0f49 100755 --- a/impl/utils/plot_spectrum_loop.py +++ b/impl/utils/plot_spectrum_loop.py @@ -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] diff --git a/impl/utils/plot_timedomain.py b/impl/utils/plot_timedomain.py index 9ae8a77..1d919b1 100755 --- a/impl/utils/plot_timedomain.py +++ b/impl/utils/plot_timedomain.py @@ -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.") -- 2.44.2 From 2768e21849ede8916c191bd47aabb618ffb4eb84 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 20 Apr 2024 01:10:14 +0200 Subject: [PATCH 2/2] test_rx_file: set nco frequency --- impl/test/layer1/test_rx_file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/impl/test/layer1/test_rx_file.c b/impl/test/layer1/test_rx_file.c index 201864b..b8afa96 100644 --- a/impl/test/layer1/test_rx_file.c +++ b/impl/test/layer1/test_rx_file.c @@ -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) { -- 2.44.2