From 3d175cf3df64b4198dc12f364a01786f751ac41c Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Thu, 11 Apr 2024 02:14:14 +0000 Subject: [PATCH] gr-iqlabs '91 with I/Q inference length. --- docker/Dockerfile.base | 2 +- gamutrf/grscan.py | 2 ++ gamutrf/scan.py | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index b488c657..018ee699 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libvulkan-dev \ python3-numpy WORKDIR /root -RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.90 +RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.91 COPY --from=iqtlabs/gamutrf-vkfft:latest /root /root/gr-iqtlabs WORKDIR /root/gr-iqtlabs/build COPY --from=iqtlabs/gamutrf-sigmf:latest /usr/local /usr/local diff --git a/gamutrf/grscan.py b/gamutrf/grscan.py index fc2dbfc0..534bbe30 100644 --- a/gamutrf/grscan.py +++ b/gamutrf/grscan.py @@ -54,6 +54,7 @@ def __init__( inference_output_dir="", inference_port=10001, inference_text_color="", + iq_inference_len=1024, iq_inference_model_name="", iq_inference_model_server="", iq_power_inference=False, @@ -297,6 +298,7 @@ def __init__( self.iq_inference_block = iqtlabs.iq_inference( tag="rx_freq", vlen=nfft, + n_vlen=int(iq_inference_len / nfft), sample_buffer=tune_step_fft, min_peak_points=inference_min_db, model_server=iq_inference_model_server, diff --git a/gamutrf/scan.py b/gamutrf/scan.py index fe76b328..d71876cd 100644 --- a/gamutrf/scan.py +++ b/gamutrf/scan.py @@ -287,6 +287,13 @@ def argument_parser(): default="", help="torchserve model server inference API address (e.g. localhost:1234)", ) + parser.add_argument( + "--iq_inference_len", + dest="iq_inference_len", + type=int, + default=4096, + help="number of samples to send for I/Q inference", + ) parser.add_argument( "--iq_inference_model_name", dest="iq_inference_model_name", @@ -484,6 +491,9 @@ def check_options(options): if options.samp_rate % options.nfft: print("NFFT should be a factor of sample rate") + if options.iq_inference_len % options.nfft: + return "NFFT should be a factor of I/Q inference length" + if options.freq_end: if options.freq_start > options.freq_end: return "freq_start must be less than freq_end"