Ofdm block

Hi all,

I’m looking to develop a block called dfts ofdm, based in a similar
block called ofdm mod, I change the .xml and .py to a new name called
DFTSOFDM, but I can’t make it work. In GRC I have the following error:

Traceback (most recent call last):
File “/home/administrador/Simulacion/top_block.py”, line 86, in

tb = top_block()
File “/home/administrador/Simulacion/top_block.py”, line 55, in
init
self.Umbrella_dftsofdm_mod_0 =
grc_blks2.packet_mod_f(Umbrella.dftsofdm_mod(
AttributeError: ‘module’ object has no attribute ‘dftsofdm_mod’

The new python file es dftsofdm.py, and I change the classes with

class dftsofdm_mod(gr.hier_block2):

class dftsofdm_demod(gr.hier_block2):

The .xml files have this changes:

Umbrella_dftsofdm_demod.xml

 <name>DFTSOFDM Demod</name>
 <key>Umbrella_dftsofdm_demod</key>
 <category>Umbrella</category>
 <import>import Umbrella</import>
 <import>from grc_gnuradio import blks2 as grc_blks2</import>
 <import>from gnuradio import digital</import>

grc_blks2.packet_demod_$(type.fcn)(Umbrella.dftsofdm_demod(
options=grc_blks2.options(
modulation="$modulation",
fft_length=$fft_length,
occupied_tones=$occupied_tones,
cp_length=$cp_length,
snr=$snr,
log=None,
verbose=None,
),
callback=lambda ok, payload: self.$(id).recv_pkt(ok, payload),
),
)

Umbrella_dftsofdm_mod.xml

DFTSOFDM Mod Umbrella_dftsofdm_mod Umbrella import Umbrella from grc_gnuradio import blks2 as grc_blks2 from gnuradio import digital grc_blks2.packet_mod_$(type.fcn)(Umbrella.dftsofdm_mod( options=grc_blks2.options( modulation="$modulation", fft_length=$fft_length, occupied_tones=$occupied_tones, cp_length=$cp_length, pad_for_usrp=$pad_for_usrp, log=None, verbose=None, ), ), payload_length=$payload_length, )

Thanks

Ivan Rodriguez

On Thu, Sep 6, 2012 at 3:59 PM, Viktor Ivan Rodriguez Abdala
[email protected] wrote:

self.Umbrella_dftsofdm_mod_0 =

grc_blks2.packet_mod_f(Umbrella.dftsofdm_mod(
AttributeError: ‘module’ object has no attribute ‘dftsofdm_mod’

Is everything properly in the CMakeLists.txt files? Did you make sure
to rebuild and reinstall? Also, if that doesn’t help, rerun cmake on
the project to make sure everything is properly reconfigured.

Tom

Hi

In the python folder, the CMakeLists.txt has

GR_PYTHON_INSTALL(
FILES
init.py dftsofdm.py DESTINATION ${GR_PYTHON_DIR}/Umbrella
)

In the grc folder

install(FILES
Umbrella_bin2dec_ff.xml
Umbrella_dec2bin_ff.xml
Umbrella_encodconv_vff.xml
Umbrella_decodconv_vff.xml
Umbrella_dftsofdm_mod.xml
Umbrella_dftsofdm_demod.xml DESTINATION share/gnuradio/grc/blocks
)

I delete all build files and rerun cmake …/ I think the problem is in
the xml file with the make section.

Ivan Rodriguez

Hi,

First I delete all the files in the build folder, later I run the follow
comands in the build folder:

  1. cmake …/
  2. make
  3. sudo make install
  4. sudo ldconfig

Ivan
Enviado desde mi oficina mvil BlackBerry de Telcel

On Mon, Sep 10, 2012 at 1:12 PM, Viktor Ivan Rodriguez Abdala
[email protected] wrote:

I delete all build files and rerun cmake …/ I think the problem is in the
xml file with the make section.

Ivan Rodriguez

After rerunning cmake, did you also ‘make’ and ‘make install’?

Tom

On Thu, Sep 13, 2012 at 1:29 AM, [email protected] wrote:

Hi,

First I delete all the files in the build folder, later I run the follow comands
in the build folder:

  1. cmake …/
  2. make
  3. sudo make install
  4. sudo ldconfig

Ivan
Enviado desde mi oficina mvil BlackBerry de Telcel

Well, that’s doing the right thing. My guess is that it’s some minor
error somewhere in your build system or something. It sounds like one
of those things that’ll be very difficult to debug via email this way.

Here’s one place to start, though. Forget GRC for the time being and
just make sure that you are installing your component correctly. So
first build and install your component, Umbrella. Then simply pop open
a Python interpreter (‘python’ or ‘ipython’ if you have the latter
installed):

import Umbrella
dir(Umbrella)

The output of the dir() command should show you what blocks are
actually installed as part of this component. That’ll give you a clue
how your installation process is working.

Tom

Hi,

I get the following output with dir(Umbrella), and I can’t see anything
called dftsofdm

[‘SwigPyIterator’, ‘SwigPyIterator_swigregister’,
‘Umbrella_bin2dec_ff_sptr’, ‘Umbrella_bin2dec_ff_sptr_swigregister’,
‘Umbrella_dec2bin_ff_sptr’, ‘Umbrella_dec2bin_ff_sptr_swigregister’,
‘Umbrella_decodconv_vff_sptr’,
‘Umbrella_decodconv_vff_sptr_swigregister’,
‘Umbrella_encodconv_vff_sptr’,
‘Umbrella_encodconv_vff_sptr_swigregister’,
‘Umbrella_swig’, ‘_RTLD_GLOBAL’, ‘builtins’, ‘doc’, ‘file’,
name’, ‘package’, ‘path’, ‘_dlopenflags’, ‘bin2dec_ff’,
‘dec2bin_ff’, ‘decodconv_vff’, ‘encodconv_vff’, ‘sys’]

How can I install my component correctly into Umbrella?

Ivan

2012/9/15 Tom R. [email protected]

On Wed, Sep 19, 2012 at 1:28 AM, Viktor Ivan Rodriguez Abdala
[email protected] wrote:

‘Umbrella_swig’, ‘_RTLD_GLOBAL’, ‘builtins’, ‘doc’, ‘file’,
name’, ‘package’, ‘path’, ‘_dlopenflags’, ‘bin2dec_ff’,
‘dec2bin_ff’, ‘decodconv_vff’, ‘encodconv_vff’, ‘sys’]

How can I install my component correctly into Umbrella?

Ivan

Did you remember to edit the SWIG .i file? It’s likely that there is
some small mistake in your build system that’s not installing
everything properly.

You should look into using gr-modtool:

It helps you automatically create GNU Radio components and blocks,
including handling the CMakeLists.txt and .i files properly.

Tom