Thanks you very much
the reason I use gnuradio 3.7 is because some OOT modules
gr-rftap https://github.com/rftap/gr-rftap
gr-rds (don't know about this one but probably would work on 3.9): https://github.com/bastibl/gr-rds
gr-rds (don't know about this one but probably would work on 3.9): https://github.com/bastibl/gr-rds
do not work on gnuradio 3.9 (rftap doesn't even work on 3.8) and I am waiting for them to port over
am not sure where you got
ninputs_written(0) from as its not defined and even looked in gnuradio 3.9 source code and couldn't find it mentioned anywhere
V V sre., 26. maj 2021 ob 00:18 je oseba Marcus Müller <mmueller@gnuradio.org> napisala:
Hi Mitja!
Great to have you here :)
Couple of things up front:
1. This is GNU Radio 3.7. Especially if you want to implement things in Python blocks, 3.8
or later is a *must*. GNU Radio 3.7 is really just in legacy keepalive mode, not actively
developed. Please update to GNU Radio 3.8 or 3.9. You really should not start developing
for GNU Radio 3.7 in 2021!
2. WX GUI is dead. We stopped being able to support it a long time ago. Please use Qt GUI
instead.
All in all, please update your version of GNU Radio. In case any bugs occur, we won't be
able to help you with GNU Radio 3.7. GNU Radio 3.8 can be natively installed on almost all
modern Linux distros directly from their package managers, and on Windows, and OS X using
conda and other tools, without any complications.
With that out of the way, let's look at your code:
for i in range(0, len(output_items[0])): #8192
output_items[0][i] = np.sin(2 * np.pi * self.frequency * (i /
self.sample_rate)) * self.amplitude
No surprise the sound is choppy! You reset your i to 0 for every new call to work();
however, GNU Radio doesn't guarantee that work is called with number of items equal to a
multiple of your sine period.
So, this is a bug in your design. What you'd want is really something like
def work(self, input_items, output_items):
# get rid of the for loop!
startnr = self.ninputs_written(0)
f_rel = 2 * np.pi * self.frequency / self.sample_rate
number = len(output_items[0])
output_items[0][:] = self.amplitude*np.sin(f_rel * np.arange(startnr, startnr+number))
return number
Best regards
Marcus
No comments:
Post a Comment