Forum: GNU Radio how to define a new variable in GRC

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C369ebbe1655201988e376af57460f23?d=identicon&s=25 Achilleas Anastasopoulos (Guest)
on 2009-06-01 00:34
(Received via mailing list)
I have 2 variable blocks in GRC called "channel" and "N"
that represent an array of channel taps and an integer, respectively.

I want to generate a new variable called "chanel_FT_inv"
which represents
1/scipy.fft(channel,N)
ie, the inverse of the channel N-length Fourier transform

How do I do that in a clean way from within GRC?

For the moment I do that manually:
I generate the .py file from GRC and then edit it to add the
corresponding piece of code...

Thanks
Achilleas
4252201ac30d6dd44d8090ce1070e35f?d=identicon&s=25 Josh Blum (Guest)
on 2009-06-01 00:47
(Received via mailing list)
Achilleas Anastasopoulos wrote:
> I have 2 variable blocks in GRC called "channel" and "N"
> that represent an array of channel taps and an integer, respectively.
>
> I want to generate a new variable called "chanel_FT_inv"
> which represents
> 1/scipy.fft(channel,N)
> ie, the inverse of the channel N-length Fourier transform

I guess the only thing your missing that that scipy is not loaded by
default in grc. So add an import block and enter: import scipy

Works?

-Josh
C369ebbe1655201988e376af57460f23?d=identicon&s=25 Achilleas Anastasopoulos (Guest)
on 2009-06-01 02:03
(Received via mailing list)
Yes, I did that.

However, GRC seems to be very unhappy with it.
Take a look at the stripped down grc block that I attach.
If you activate/deactivate a couple of times the
variable block you get error messages/red boxes and the graph cannot be
executed...

I don't know where this is coming from...

Achilleas



Josh Blum wrote:

 >
 > I guess the only thing your missing that that scipy is not loaded by
 > default in grc. So add an import block and enter: import scipy
 >
 > Works?
 >
 > -Josh
4252201ac30d6dd44d8090ce1070e35f?d=identicon&s=25 Josh Blum (Guest)
on 2009-06-01 03:37
(Received via mailing list)
Ack! Something very strange is happening when numpy/scipy is imported. I
will let you know when its fixed/figured out. -Josh
4252201ac30d6dd44d8090ce1070e35f?d=identicon&s=25 Josh Blum (Guest)
on 2009-06-01 07:09
(Received via mailing list)
svn up and try it now. I commented out the eval caching. I still cant
put my finger on exactly what went wrong. Or why the behavior is
different, newer numpy, python 2.6...

Anyway, I will keep digging.

-Josh
This topic is locked and can not be replied to.