Help on editing a usrp1_source_c.cc file

Hi,

In the ‘…/gr-usrp/src/usrp1_source_c.cc’ file there is a function
‘copy_from_usrp_buffer’. I would like to analyze the complex signal
converted from 16-bit interleaved I and Q signal.

I have changed the ‘usrp1_source_c.cc’ file to open a file using
fstream class and copy the complex signal onto this file. I have
implemented this in the function ‘copy_from_buffer’. I built GNU
radio software again after the changes. I assumed this would work.
But it is not. I am sure to be missing something. Debug prints say
that this file is not being opened while this file can be opened by
any other C++ program that is not part of GNU software.

Or is there anything that I have to change in .i file as well?

Thanks for any and all help.

Meenaktchi V.

On 6/21/07, Meenaktchi V. [email protected] wrote:

Hi,

In the ‘…/gr-usrp/src/usrp1_source_c.cc’ file there is a function
‘copy_from_usrp_buffer’. I would like to analyze the complex signal
converted from 16-bit interleaved I and Q signal.

You can try …/gnuradio-examples/python/usrp/usrp_rx_cfile.py for this
purpose.

I have changed the ‘usrp1_source_c.cc’ file to open a file using

fstream class and copy the complex signal onto this file. I have
implemented this in the function ‘copy_from_buffer’. I built GNU
radio software again after the changes. I assumed this would work.
But it is not. I am sure to be missing something. Debug prints say
that this file is not being opened while this file can be opened by
any other C++ program that is not part of GNU software.

Or is there anything that I have to change in .i file as well?

IT depends, how would you like to call your object from Python. As long
as
you dont need to call it from Python, change in .i-file is not required.
So
far, its not clear whether you are controlling your file from
outside/Python
or its part of general_work function.

PS: Next time you update your gnuradio from svn, possibly the changed
file
will be replaced.

Thanks for any and all help.

Meenaktchi V.

~Tarun

Thanks Tarun, this helped.

Is there anyway to do the opposite? I have 16-bit I and Q data, I would
like
to send this data to USRP and transmit

Thanks
Meenaktchi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Meenaktchi V. wrote:

Thanks Tarun, this helped.

Is there anyway to do the opposite? I have 16-bit I and Q data, I would
like
to send this data to USRP and transmit

Thanks
Meenaktchi

To log data from the USRP: usrp.source_c → gr.file_sink(complex)
To replay data to the USRP: gr.file_source(complex) → usrp.sink_c

  • -Dan
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGeuVSy9GYuuMoUJ4RAgi+AJ0SW+l/dlQYVpqHm/T3cbZuMym2hQCfTMDF
o9zq9y2gdBX/L5iE1NXm4Sg=
=V91g
-----END PGP SIGNATURE-----

usrp_rx_cfile.py logs data using gr.file_sink and the output file is a
binary file. Can I have a .dat output file?

I guess for replaying data using the gr.file_source -> usrp.sink_c, the
gr.file_source would be reading from a .dat file

Thanks for all help
Meenaktchi