On 06/01/2019 04:16 PM, d.des wrote:
I want to add a phase shift block to a grc flowgraph that is controlled
by a scrollbar. Searching for "phase shift block" returns several
suggestions from several years ago to use the "Multiply Const" block
with the argument: "math.cos(angle), math.sin(angle)" in the "const"
field. If I try that I get the error:
Expression None is invalid for type 'complex'.
The expression should be:
complex(math.cos(angle-in-radians),math.sin(angle-in-radians))
This is standard Python stuff, not specifically related to GRC or Gnu Radio.
The assumption is that if you're going to be inserting Python
expressions that those expressions
are correct Python expressions.
I can enter fixed complex variables or references to other variables or
parameters, I just can't do trig functions. I'm currently using the
equation: "pow(10,snr/20.)" in a Noise Source block and it understands
that just fine. Is there a way to do trig functions in a block field?
I'm currently using a clean install and build of gnuradio retrieved
from git a few days ago, but this issue has been the case for the
several versions I've retrieved and built over the past year or so. I
ended up building a hier block with complex_to_magphase, add constant,
and the magphase_to_complex but that seems very inefficient. The
transcendental function seems to be oriented to streams rather than
constants that rarely change. I also considered an OOT block but that
also seems like overkill. Surely I'm missing something really simple.
Thanks!
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio