Modulation/Demodulation Blocks' Function details

Hi GNURadio community,

I’m looking into how the modulation and demodulation blocks work.
Specifically the BPSK mod and demod blocks. Here is a list of the files
I
looked through and the location:

generic_mod_demod.py - */gr-digital/python
modulation_utils.py - */gr-digital/python
bpsk.py - */gr-digital/python
digital_constellation.h - */gr-digital/include
digital_constellation.cc - */gr-digital/lib
digital_swig.py - */build/gr-digital/swig

gr_phase_modulator_fc.h - */gnuradio-core/src/lib/general
gr_phase_modulator_fc.cc - */gnuradio-core/src/lib/general

digital_gmskmod_bc.h - */gr-digital/include
digital_gmskmod_bc.cc - */gr-digital/lib

gr_diff_encoder_bb.h - */gnuradio-core/src/lib/general for
differntialBPSK
gr_diff_encoder_bb.cc - */gnuradio-core/src/lib/general for
differntialBPSK

gr_unpack_k_bits_bb.h - */gnuradio-core/src/lib/general
gr_unpack_k_bits_bb.cc - */gnuradio-core/src/lib/general

Are there any other files I should look at the get an understanding what
happens to the bits?

In the generic_mod_demod.py file, I come across functions like
digital.map_bb(mod_codes.invert_code(self._constellation.pre_diff_code()))
and I find the function map_bb in the digital_swig.py file. But the only
code there is
return _digital_swig.map_bb(*args, **kwargs)
I can’t find anything on _digital_swig no matter where I look.
_digital_swig was set to something at the beginning of the file, but I
couldn’t understand it. Can someone tell me where to look to find the
source code for the _digital_swig.maps_bb() and the
_digital_swig.pfb_clock_sync_ccf() functions?

Also another thing I’ve been wondering is why is there the DIGITAL_API
in
some lines. For example,
class DIGITAL_API digital_constellation : public
boost::enable_shared_from_this<digital_constellation>
What is the point of DIGITAL_API?

Thanks a lot,
Frederick

On 09/08/12 18:55, Frederick L. wrote:

digital_constellation.cc - */gr-digital/lib
gr_diff_encoder_bb.cc - */gnuradio-core/src/lib/general for
and I find the function map_bb in the digital_swig.py file. But the only
code there is
return _digital_swig.map_bb(*args, **kwargs)
I can’t find anything on _digital_swig no matter where I look.
_digital_swig was set to something at the beginning of the file, but I
couldn’t understand it. Can someone tell me where to look to find the
source code for the _digital_swig.maps_bb() and the
_digital_swig.pfb_clock_sync_ccf() functions?

Swig stuff are python bindings to C or C++ code. So in your example
pfb_clock_sync_ccf() has been coded in C++, and
_digital_swig.pfb_clock_sync_ccf() is the generated python wrapper to
access the C++ pfb_clock_sync_ccf() from a python script.
The C++ code is in include/ and lib/, swig bindings are in swig/ and
pure python code is in python/

See http://gnuradio.org/redmine/projects/gnuradio/wiki/Coding_guide_impl

Also another thing I’ve been wondering is why is there the DIGITAL_API
in some lines. For example,
class DIGITAL_API digital_constellation : public
boost::enable_shared_from_this<digital_constellation>
What is the point of DIGITAL_API?
This is a standard way to import/export symbols from/to .so or .dll in a
platform/OS agnostic way.
Look at gr-digital/include/digital_api.h

Hope this help.
Chris

Thanks a lot,
Frederick

This body part will be downloaded on demand.


Christian G.,
Embedded systems engineer.
Techworks Marine
1 Harbour road
Dun Laoghaire
Co. Dublin
Ireland
Tel: + 353 (0) 1 236 5990
Web: http://www.techworks.ie/

Swig stuff are python bindings to C or C++ code. So in your example
pfb_clock_sync_ccf() has been coded in C++, and
_digital_swig.pfb_clock_sync_ccf() is the generated python wrapper to
access the C++ pfb_clock_sync_ccf() from a python script.

The C++ code is in include/ and lib/, swig bindings are in swig/ and pure
python code is in python/

See http://gnuradio.org/redmine/projects/gnuradio/wiki/Coding_
guide_implhttp://gnuradio.org/redmine/projects/gnuradio/wiki/Coding_guide_impl

Hi Chris,

I never found that page on the gnuradio site. Thanks for clearing up
what
_digital_swig was. I was able to do a search in my gnuradio folder for
pfb_clock_sync_ccf and map_bb and found the header and source files.

Cheers,
Frederick

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs