discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: usage of gr.decim_block with python


From: Jeff Long
Subject: Re: usage of gr.decim_block with python
Date: Wed, 3 Mar 2021 07:10:05 -0500

In 3.8, I don't think you can change the decimation factor after instantiation.

In 3.9+, more of the internal functions, e.g., set_decimation() are exported via PyBind11 BUT there might be some unknowns in how things work if you subclass from the Python blocks (as in 3.8) and then use pybind-exported functions.

On Wed, Mar 3, 2021 at 6:29 AM Harald Fritzsche <dd0vs@dd0vs.de> wrote:
Hello Jeff,
thanks for your reply.
Yes, thats what i did.
But for the work function i need to access the decimiation-value.
I have no glue how :-(

vy73
Harald
DD0VS
Am Wed, 3 Mar 2021 06:15:20 -0500
schrieb Jeff Long <willcode4@gmail.com>:

> If your block inherits from decim_block, then you can set the
> decimation statically when you call the superclass initializer in
> your block's init. In Python3 it would be something like:
>
> class MyBlock(decim_block):
>     def __init__(self, decim):
>         super().__init__(name, in_sig, out_sig, decim)
>         ...
>
>
> On Wed, Mar 3, 2021 at 1:44 AM Harald Fritzsche <dd0vs@dd0vs.de>
> wrote:
>
> > Hello all,
> >
> > i am struggling a bit with gr.decim_block.
> >
> > I think its possible to call e.g. self.set_decimation(decim).
> >
> > But whatever i do, GRC and python tells me:
> >
> > AttributeError: 'blk' object has no attribute 'decimation'
> > (in case i try self.decimation())
> >
> > I am a little bit lost and need guidance.
> >
> > (under Windows 10 with gr 3.8 – a big thank you to Geof Nieboer!!!!)
> >
> > Vy73
> > Harald
> > DD0VS
> >
> > 
>


reply via email to

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