Skip to content

Commit

Permalink
Merge pull request #1072 from anarkiwi/samp
Browse files Browse the repository at this point in the history
sample size fix.
  • Loading branch information
anarkiwi authored Jan 4, 2024
2 parents 69a0dfe + f0b9324 commit e9a8a32
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gamutrf/grsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ def general_work(self, input_items, output_items):
if self.tags_sent:
n = min(self.nfft, len(output_items[0]))
samples = self.samples[self.i : self.i + n]
self.i += len(samples)
if len(samples) < len(output_items[0]):
zeros = np.zeros(
len(output_items[0]) - len(samples), dtype=np.complex64
)
c = len(samples)
self.i += c
if c < len(output_items[0]):
zeros = np.zeros(len(output_items[0]) - c, dtype=np.complex64)
samples = np.append(samples, zeros)
else:
# feed zeros until received first tag request
samples = np.zeros(len(output_items[0]), dtype=np.complex64)
c = len(samples)
output_items[0][:] = samples
return len(samples)
return c


def get_throttle(samp_rate, items):
Expand Down

0 comments on commit e9a8a32

Please sign in to comment.