Skip to content

Commit

Permalink
Reduce maximum output size per call for simulated radios.
Browse files Browse the repository at this point in the history
  • Loading branch information
anarkiwi committed Dec 20, 2023
1 parent 172c896 commit 99a654c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gamutrf/grsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ def work(self, input_items, output_items):
return len(samples)


def get_throttle(samp_rate, rate=0.1):
return blocks.throttle(
gr.sizeof_gr_complex, samp_rate, True, max(int(rate * samp_rate), 1)
)


def get_source(
sdr,
samp_rate,
Expand All @@ -110,7 +116,7 @@ def get_source(
if url.scheme == "file" and os.path.exists(url.path):
sources = [
file_source_tagger(url.path, cmd_port),
blocks.throttle(gr.sizeof_gr_complex, samp_rate, True),
get_throttle(samp_rate),
]
else:
raise ValueError("unsupported/missing file location")
Expand All @@ -119,7 +125,7 @@ def get_source(
cmd_port = "cmd"
sources = [
iqtlabs.tuneable_test_source(freq_divisor),
blocks.throttle(gr.sizeof_gr_complex, samp_rate, True),
get_throttle(samp_rate),
]
elif sdr == "ettus":
sources = get_ettus_source(sdrargs, samp_rate, center_freq, agc, gain, uhd_lib)
Expand Down

0 comments on commit 99a654c

Please sign in to comment.