discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] how to define a new variable in GRC


From: Achilleas Anastasopoulos
Subject: Re: [Discuss-gnuradio] how to define a new variable in GRC
Date: Sun, 31 May 2009 20:01:29 -0400
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)


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



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


<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
  <timestamp>Sun May 31 19:50:06 2009</timestamp>
  <block>
    <key>options</key>
    <param>
      <key>id</key>
      <value>top_block</value>
    </param>
    <param>
      <key>_enabled</key>
      <value>True</value>
    </param>
    <param>
      <key>title</key>
      <value>untitled</value>
    </param>
    <param>
      <key>author</key>
      <value>unknown</value>
    </param>
    <param>
      <key>description</key>
      <value>gnuradio flow graph</value>
    </param>
    <param>
      <key>window_size</key>
      <value>1280, 1024</value>
    </param>
    <param>
      <key>generate_options</key>
      <value>wx_gui</value>
    </param>
    <param>
      <key>category</key>
      <value>Custom</value>
    </param>
    <param>
      <key>realtime_scheduling</key>
      <value></value>
    </param>
    <param>
      <key>_coordinate</key>
      <value>(10, 10)</value>
    </param>
    <param>
      <key>_rotation</key>
      <value>0</value>
    </param>
  </block>
  <block>
    <key>import</key>
    <param>
      <key>id</key>
      <value>import_0</value>
    </param>
    <param>
      <key>_enabled</key>
      <value>True</value>
    </param>
    <param>
      <key>import</key>
      <value>from scipy import fft</value>
    </param>
    <param>
      <key>_coordinate</key>
      <value>(47, 110)</value>
    </param>
    <param>
      <key>_rotation</key>
      <value>0</value>
    </param>
  </block>
  <block>
    <key>variable</key>
    <param>
      <key>id</key>
      <value>channel</value>
    </param>
    <param>
      <key>_enabled</key>
      <value>True</value>
    </param>
    <param>
      <key>value</key>
      <value>[1,0,0,0]</value>
    </param>
    <param>
      <key>_coordinate</key>
      <value>(40, 203)</value>
    </param>
    <param>
      <key>_rotation</key>
      <value>0</value>
    </param>
  </block>
  <block>
    <key>gr_null_sink</key>
    <param>
      <key>id</key>
      <value>gr_null_sink_0</value>
    </param>
    <param>
      <key>_enabled</key>
      <value>True</value>
    </param>
    <param>
      <key>type</key>
      <value>complex</value>
    </param>
    <param>
      <key>vlen</key>
      <value>1</value>
    </param>
    <param>
      <key>_coordinate</key>
      <value>(990, 125)</value>
    </param>
    <param>
      <key>_rotation</key>
      <value>0</value>
    </param>
  </block>
  <block>
    <key>gr_noise_source_x</key>
    <param>
      <key>id</key>
      <value>gr_noise_source_x_0</value>
    </param>
    <param>
      <key>_enabled</key>
      <value>True</value>
    </param>
    <param>
      <key>type</key>
      <value>complex</value>
    </param>
    <param>
      <key>noise_type</key>
      <value>gr.GR_GAUSSIAN</value>
    </param>
    <param>
      <key>amp</key>
      <value>1</value>
    </param>
    <param>
      <key>seed</key>
      <value>42</value>
    </param>
    <param>
      <key>_coordinate</key>
      <value>(342, 354)</value>
    </param>
    <param>
      <key>_rotation</key>
      <value>0</value>
    </param>
  </block>
  <block>
    <key>variable</key>
    <param>
      <key>id</key>
      <value>inv_FT_channell</value>
    </param>
    <param>
      <key>_enabled</key>
      <value>True</value>
    </param>
    <param>
      <key>value</key>
      <value>fft(channel,32)</value>
    </param>
    <param>
      <key>_coordinate</key>
      <value>(18, 270)</value>
    </param>
    <param>
      <key>_rotation</key>
      <value>0</value>
    </param>
  </block>
  <connection>
    <source_block_id>gr_noise_source_x_0</source_block_id>
    <sink_block_id>gr_null_sink_0</sink_block_id>
    <source_key>0</source_key>
    <sink_key>0</sink_key>
  </connection>
</flow_graph>

reply via email to

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