discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Python tutorials (was: Re: Discuss-gnuradio Digest, Vol 250, Issue 1


From: SHAKTHIVEL S 2021 Batch,PES University
Subject: Re: Python tutorials (was: Re: Discuss-gnuradio Digest, Vol 250, Issue 16)
Date: Mon, 21 Aug 2023 06:46:09 +0530

Hi Marcus,
I got small doubt after looking at your reply, the self.consume takes (inputport , len(in0)) as arguments but the input length depends on the number of output_items / input_items as in0 = input_items[0][:len(output_items[0])] which  inturn depends on the noutput_items / ninput_items variable , right? 
My doubt is ,aren't the below functions in top_block.py define the default length of input vectors / value of ninput_items?

 def start(self, max_noutput_items=10000000):
        """
        Start the flowgraph with the given number of output items and return.
        """
        top_block_start_unlocked(self._impl, max_noutput_items)

    def stop(self):
        """
        Stop the flowgraph
        """
        top_block_stop_unlocked(self._impl)

    def run(self, max_noutput_items=10000000):
        """
        Start the flowgraph with the given number of output items and wait.
        """
        self.start(max_noutput_items)
        self.wait()

Thanks and regards
Shakti

On Sun, Aug 20, 2023 at 4:02 PM Marcus Müller <marcus.mueller@ettus.com> wrote:

Hi Shakti, hi Tom,

first off: a friendly reminder to **not** forget to change the subject line when replying to digest emails, see the sentence you literally replied to:

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Discuss-gnuradio digest..."

Anyways, what Shakti recommends makes not too much sense, sorry! All the files are "exported from wiki", in other words, the original version is in the very wiki with the tutorials in it. That's why it says that in the file name :)

https://wiki.gnuradio.org/index.php?title=Usage_Manual

To address Tom's questions:

> If I use the "input" to the block, how many samples are processed each time the Python code is called?

As many as you process. That's up to your code! In a general block, you need to call `self.consume` (or `consume_each`) yourself to tell the runtime how much of the available input you consumed.

You need to return the number of samples you have produced at the end of your (`general_`) work method.

In the sync block (and fixed-rate decimator and interpolators), what you return inherently defines how much you consumed, so don't call `consume` or `consume_each` in that case.

> Does it pass a byte, float, complex, vector, etc... on at a time?

No, but that's really clearly illustrated in the Python tutorial! See https://wiki.gnuradio.org/index.php?title=Creating_Your_First_Block#Editing_Work_Function : As you can see, `input_items` is a vector of vectors, each row containing the input items from one of the input ports your block has, and then each vector there is many items.

> Does it work on each sample or can you send it an array? Is the Python in/out synchronized with the data stream?

It's not clear what you mean here. "the data stream" is what you're processing here.

Cheers,

Marcus


On 20.08.23 05:03, SHAKTHIVEL S 2021 Batch,PES University wrote:
Hi, 
You may check in the docs folder in the GitHub page under usage-manual, Handling flowgraphs.txt and types of blocks.txt files until someone who is expert answer your questions. 
Hope that helps. 
Thanks.. 
Shakti

On Sun, Aug 20, 2023, 04:54 tom sutherland <alphatozeta@yahoo.com> wrote:
I've gone through the Python tutorial but have some questions. If I use the "input" to the block, how many samples are processed each time the Python code is called? Does it pass a byte, float, complex, vector, etc... on at a time? Does it work on each sample or can you send it an array? Is the Python in/out synchronized with the data stream?
Thanks...Tom

On Friday, August 18, 2023 at 11:03:02 AM CDT, discuss-gnuradio-request@gnu.org <discuss-gnuradio-request@gnu.org> wrote:


Send Discuss-gnuradio mailing list submissions to

To subscribe or unsubscribe via the World Wide Web, visit
or, via email, send a message with subject or body 'help' to

You can reach the person managing the list at

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Discuss-gnuradio digest..."


Today's Topics:

  1. [GRCon'23] Keynotes, Workshops, Sponsors: It's all coming
      together! (Marcus Müller)
  2. Re: Using a signal as a parameter in a block? (Marcus Müller)
  3. Re: Discuss-gnuradio Digest, Vol 250, Issue 15 (Sowji Srinithi)
  4. LookupError: KeyError: No devices found (was: Re:
      Discuss-gnuradio Digest, Vol 250, Issue 15) (Marcus Müller)


----------------------------------------------------------------------

Message: 1
Date: Thu, 17 Aug 2023 18:04:52 +0200
From: Marcus Müller <mmueller@gnuradio.org>
To: Gnuradio Mailing List <discuss-gnuradio@gnu.org>
Subject: [GRCon'23] Keynotes, Workshops, Sponsors: It's all coming
    together!
Content-Type: text/plain; charset=UTF-8; format=flowed

Dear Community,

GNU Radio Conference 2023 is coming closer! (It takes place starting
Sep. 5 in Tempe, Arizona, USA. Tickets happen to be $100 cheaper until
2023-08-18 [0].)

== Keynotes ==

The Conference Organizers are quite happy to see an excellent list of
Keynote speakers[1] come together for the four conference days:

With Lindy Elkins-Tanton, we have been able to secure the NASA Principal
Investigator for the Psyche Mission, and an all-around impressive
scientist and research leader on the formation of rocky planets. If
being elected into the National Academy of Sciences is not enough
credit: there's an asteroid named after her.
On the technical and historical side, I'm personally looking forward to
seeing Eric Blossom again: he, as the first head of architecture, has
been formative to the things that make GNU Radio what it is. Currently,
he's working on high-speed satellite radios.
Don't forget that SDR involves, famously, not only software, but also
radio. Constantine Balanis' contributions to the field of radio
technology are not limited to his authorship of the standard textbook on
antennas – he's been at the forefront of EM simulation and RF channel
theory and thus set many cornerstones for wireless communications and
sensing applications everywhere.
Of course, if we invite GNU Radio's history, we should also be inviting
someone working on the future of GNU Radio: That'd be Ralph Steinhagen,
head developer for systems integration at FAIR, one of the largest and
technically most advanced particle accelerators, who, together with his
team, is putting in all the work to bring a shared vision of GNU Radio
4.0 to life.

== Workshops ==

But the value of a conference is not found exclusively in the
higher-profile talks, but also in the ways that it enables people to
actually have a closer look at things, together. Workshops [2] have been
a staple of GRCon's popularity for years, and this year is no exception
with a total count of 10 workshops, covering topics from basic DSP, over
GNU Radio use, transceiver design, embedded Linux-based SDR development,
and FPGA usage on SDR devices, to FOSS 5G network setup with srsRAN.

== Sponsors ==

As you might guess, organizing all this takes effort – and executing
takes a lot of funds. Hence, we're very glad we've found sponsors [3]
for this year's GRCon. Next to a few industry-standard names, it's
especially nice to see breakthrough startups and research organizations
take up the chance to present themselves to the GNU Radio audience. You
can, when buying tickets [0], directly choose a Patron Ticket, which
gives you a cheap opportunity to place your logo on the GRCon website;
if that's what you want to do, or if you care for other sponsorship
packages, don't hesitate to reach out to sponsor@gnuradio.org.

So, for now: I'm looking forward to seeing you there!

-- Marcus

[2]




------------------------------

Message: 2
Date: Thu, 17 Aug 2023 20:08:51 +0200
From: Marcus Müller <mmueller@gnuradio.org>
Subject: Re: Using a signal as a parameter in a block?
Content-Type: text/plain; charset=UTF-8; format=flowed

Hi Tom,

You are assuming the "delay" input of the Delay block was sample-synchronous – it's not!
Messages are asynchronous to samples by design. Repeating the same message hence doesn't
do what you want:
What you're trying to do, keep the delay constant for 1023 samples, then change it, keep
it constant… but that would require that the delay block "waits" for a new message for
every sample it processes. It doesn't (and it can't).

I think in your situation, learning how to write a Python (or C++, if that's easier for
you) block to do in one place what you want to happen here would be the only solution –
and not too hard.

Best regards,
Marcus

On 17.08.23 14:59, tom sutherland wrote:
> I want to use the output value of a signal generator as the delay value of a delay block.
> Is there a way to pass the output of a signal generator(saw tooth) to the delay block? I
> have attached an initial grc file and a picture of what I want to do. Any help would be
> appreciated.
> Thanks...Tom
> PS Do you know if I need to sign up for any workshops, etc.. at the GNURadio Conference
> next month or do I just show up and take a seat? I've already registered.
>
> Inline image
>
>



------------------------------

Message: 3
Date: Fri, 18 Aug 2023 13:41:16 +0530
From: Sowji Srinithi <sowjisrinithi@gmail.com>
Subject: Re: Discuss-gnuradio Digest, Vol 250, Issue 15
Message-ID:
Content-Type: text/plain; charset="utf-8"

Qt GUI: Could not restore geometry: restoreGeometry(self, geometry:
Union[QByteArray, bytes, bytearray]): argument 1 has unexpected type
'NoneType' [INFO] [UHD] linux; GNU C++ version 12.3.0; Boost_107400;
UHD_4.4.0.0+ds1-4 Traceback (most recent call last): File
"/home/sowjanya/Downloads/fm_example.py", line 238, in <module> main() File
"/home/sowjanya/Downloads/fm_example.py", line 216, in main tb =
top_block_cls() ^^^^^^^^^^^^^^^ File
"/home/sowjanya/Downloads/fm_example.py", line 84, in __init__
self.uhd_usrp_source_0 = uhd.usrp_source( ^^^^^^^^^^^^^^^^ RuntimeError:
LookupError: KeyError: No devices found for -----> Empty Device Address how
to fix this error

How to fix the above error

On Thu, 17 Aug 2023 at 21:37, <discuss-gnuradio-request@gnu.org> wrote:

> Send Discuss-gnuradio mailing list submissions to
>
> To subscribe or unsubscribe via the World Wide Web, visit
> or, via email, send a message with subject or body 'help' to
>
> You can reach the person managing the list at
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Discuss-gnuradio digest..."
>
>
> Today's Topics:
>
>    1. Using a signal as a parameter in a block? (tom sutherland)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 17 Aug 2023 12:59:58 +0000 (UTC)
> From: tom sutherland <alphatozeta@yahoo.com>
> Subject: Using a signal as a parameter in a block?
> Content-Type: text/plain; charset="utf-8"
>
> I want to use the output value of a signal generator as the delay value of
> a delay block. Is there a way to pass the output of a signal generator(saw
> tooth) to the delay block? I have attached an initial grc file and a
> picture of what I want to do. Any help would be appreciated.Thanks...TomPS
> Do you know if I need to sign up for any workshops, etc.. at the GNURadio
> Conference next month or do I just show up and take a seat? I've already
> registered.
>
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> >
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: 1692277050668blob.jpg
> Type: image/png
> Size: 41672 bytes
> Desc: not available
> URL: <
> >
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: rampAsDelayInput.grc
> Type: application/octet-stream
> Size: 4072 bytes
> Desc: not available
> URL: <
> >
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: RampAsDelayInput.png
> Type: image/png
> Size: 30385 bytes
> Desc: not available
> URL: <
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Discuss-gnuradio mailing list
>
>
> ------------------------------
>
> End of Discuss-gnuradio Digest, Vol 250, Issue 15
> *************************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 4
Date: Fri, 18 Aug 2023 10:35:09 +0200
From: Marcus Müller <marcus.mueller@ettus.com>
Subject: LookupError: KeyError: No devices found (was: Re:
    Discuss-gnuradio Digest, Vol 250, Issue 15)
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Hi Sowji,

according to the text you've replied to:

> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Discuss-gnuradio digest..."

I changed the subject line to actually describe the contents of your email. Please get in
the habit of doing that :)

Anyways, as you notice, this is an error related to UHD not finding any USRP devices.
Since we don't know which device you have, we can't help you with that. But to expedite a
solution: Guides to this are found in dozens of corners on the internet, for example


Best,

Marcus


On 18.08.23 10:11, Sowji Srinithi wrote:
> Qt GUI: Could not restore geometry: restoreGeometry(self, geometry: Union[QByteArray,
> bytes, bytearray]): argument 1 has unexpected type 'NoneType' [INFO] [UHD] linux; GNU
> C++ version 12.3.0; Boost_107400; UHD_4.4.0.0+ds1-4 Traceback (most recent call last):
> File "/home/sowjanya/Downloads/fm_example.py", line 238, in <module> main() File
> "/home/sowjanya/Downloads/fm_example.py", line 216, in main tb = top_block_cls()
> ^^^^^^^^^^^^^^^ File "/home/sowjanya/Downloads/fm_example.py", line 84, in __init__
> self.uhd_usrp_source_0 = uhd.usrp_source( ^^^^^^^^^^^^^^^^ RuntimeError: LookupError:
> KeyError: No devices found for -----> Empty Device Address how to fix this error
>
> How to fix the above error
>
> On Thu, 17 Aug 2023 at 21:37, <discuss-gnuradio-request@gnu.org> wrote:
>
>    Send Discuss-gnuradio mailing list submissions to
>
>    To subscribe or unsubscribe via the World Wide Web, visit
>    or, via email, send a message with subject or body 'help' to
>
>    You can reach the person managing the list at
>
>    When replying, please edit your Subject line so it is more specific
>    than "Re: Contents of Discuss-gnuradio digest..."
>
>
>    Today's Topics:
>
>       1. Using a signal as a parameter in a block? (tom sutherland)
>
>
>    ----------------------------------------------------------------------
>
>    Message: 1
>    Date: Thu, 17 Aug 2023 12:59:58 +0000 (UTC)
>    From: tom sutherland <alphatozeta@yahoo.com>
>    Subject: Using a signal as a parameter in a block?
>    Content-Type: text/plain; charset="utf-8"
>
>    I want to use the output value of a signal generator as the delay value of a delay
>    block. Is there a way to pass the output of a signal generator(saw tooth) to the
>    delay block? I have attached an initial grc file and a picture of what I want to do.
>    Any help would be appreciated.Thanks...TomPS Do you know if I need to sign up for
>    any workshops, etc.. at the GNURadio Conference next month or do I just show up and
>    take a seat? I've already registered.
>
>
>
>
>    -------------- next part --------------
>    An HTML attachment was scrubbed...
>    URL:
>    -------------- next part --------------
>    A non-text attachment was scrubbed...
>    Name: 1692277050668blob.jpg
>    Type: image/png
>    Size: 41672 bytes
>    Desc: not available
>    URL:
>    -------------- next part --------------
>    A non-text attachment was scrubbed...
>    Name: rampAsDelayInput.grc
>    Type: application/octet-stream
>    Size: 4072 bytes
>    Desc: not available
>    URL:
>    -------------- next part --------------
>    A non-text attachment was scrubbed...
>    Name: RampAsDelayInput.png
>    Type: image/png
>    Size: 30385 bytes
>    Desc: not available
>    URL:
>
>    ------------------------------
>
>    Subject: Digest Footer
>
>    _______________________________________________
>    Discuss-gnuradio mailing list
>
>
>    ------------------------------
>
>    End of Discuss-gnuradio Digest, Vol 250, Issue 15
>    *************************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Subject: Digest Footer

_______________________________________________
Discuss-gnuradio mailing list


------------------------------

End of Discuss-gnuradio Digest, Vol 250, Issue 16
*************************************************

reply via email to

[Prev in Thread] Current Thread [Next in Thread]