Browse Source

completed rename of project (CRFA -> MULTIRDS)

fixed error correction of A and B groups
master
Clemens Richter 9 years ago
parent
commit
6e747067a2
  1. 4
      CMakeLists.txt
  2. 2
      MANIFEST.md
  3. 342
      apps/fft-multi-decoder_fixed_hackrf.grc
  4. 18
      cmake/Modules/multirdsConfig.cmake
  5. 2
      docs/doxygen/Doxyfile.in
  6. 4
      docs/doxygen/other/group_defs.dox
  7. 4
      docs/doxygen/other/main_page.dox
  8. 3
      grc/CMakeLists.txt
  9. 3
      include/multirds/CMakeLists.txt
  10. 10
      include/multirds/api.h
  11. 8
      include/multirds/rds_decoder.h
  12. 8
      include/multirds/rds_decoder_redsea.h
  13. 8
      include/multirds/sync_decim.h
  14. 3
      lib/CMakeLists.txt
  15. 2
      lib/constants.h
  16. 6
      lib/qa_multirds.h
  17. 6
      lib/rds_decoder_impl.h
  18. 45
      lib/rds_decoder_redsea_impl.cc
  19. 6
      lib/rds_decoder_redsea_impl.h
  20. 3
      lib/sync_decim_impl.cc
  21. 6
      lib/sync_decim_impl.h
  22. 2
      python/__init__.py
  23. 2
      python/rds_parser_table_qt.py
  24. 5
      swig/multirds_swig.i

4
CMakeLists.txt

@ -164,8 +164,8 @@ link_directories(
) )
# Set component parameters # Set component parameters
set(GR_CRFA_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "" FORCE) set(GR_MULTIRDS_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "" FORCE)
set(GR_CRFA_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/swig CACHE INTERNAL "" FORCE) set(GR_MULTIRDS_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/swig CACHE INTERNAL "" FORCE)
######################################################################## ########################################################################
# Create uninstall target # Create uninstall target

2
MANIFEST.md

@ -1,4 +1,4 @@
title: The CRFA OOT Module title: The MULTIRDS OOT Module
brief: Short description of gr-multirds brief: Short description of gr-multirds
tags: # Tags are arbitrary, but look at CGRAN what other authors are using tags: # Tags are arbitrary, but look at CGRAN what other authors are using
- sdr - sdr

342
apps/fft-multi-decoder_fixed_hackrf.grc

@ -2492,171 +2492,6 @@
<value>1</value> <value>1</value>
</param> </param>
</block> </block>
<block>
<key>multirds_decoder_compare</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>0</value>
</param>
<param>
<key>_coordinate</key>
<value>(1757, 231)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>multirds_decoder_compare_0</value>
</param>
<param>
<key>nPorts</key>
<value>6</value>
</param>
</block>
<block>
<key>multirds_rds_parser_table_qt</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>debug</key>
<value>False</value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>_coordinate</key>
<value>(1589, 423)</value>
</param>
<param>
<key>gui_hint</key>
<value>tabs@1:7,1,5,3</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>multirds_rds_parser_table_qt_0_0</value>
</param>
<param>
<key>label</key>
<value></value>
</param>
<param>
<key>log</key>
<value>False</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>nPorts</key>
<value>9</value>
</param>
<param>
<key>freq_tune</key>
<value>freq_tune</value>
</param>
<param>
<key>workdir</key>
<value>/user/wire2/richter/data/</value>
</param>
<param>
<key>writeDB</key>
<value>True</value>
</param>
</block>
<block>
<key>multirds_tmc_parser</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>debug</key>
<value>False</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(1880, 512)</value>
</param>
<param>
<key>gui_hint</key>
<value>tabs@1</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>multirds_tmc_parser_0</value>
</param>
<param>
<key>label</key>
<value></value>
</param>
<param>
<key>log</key>
<value>False</value>
</param>
<param>
<key>maxheight</key>
<value>0</value>
</param>
<param>
<key>workdir</key>
<value>/user/wire2/richter/data/</value>
</param>
<param>
<key>writeDB</key>
<value>True</value>
</param>
</block>
<block> <block>
<key>epy_block</key> <key>epy_block</key>
<param> <param>
@ -3583,6 +3418,171 @@ class blk(gr.sync_block): # other base classes are basic_block, decim_block, in
<value>samp_rate</value> <value>samp_rate</value>
</param> </param>
</block> </block>
<block>
<key>multirds_decoder_compare</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>0</value>
</param>
<param>
<key>_coordinate</key>
<value>(1757, 231)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>multirds_decoder_compare_0</value>
</param>
<param>
<key>nPorts</key>
<value>6</value>
</param>
</block>
<block>
<key>multirds_rds_parser_table_qt</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>debug</key>
<value>False</value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>_coordinate</key>
<value>(1589, 423)</value>
</param>
<param>
<key>gui_hint</key>
<value>tabs@1:7,1,5,3</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>multirds_rds_parser_table_qt_0_0</value>
</param>
<param>
<key>label</key>
<value></value>
</param>
<param>
<key>log</key>
<value>False</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>nPorts</key>
<value>9</value>
</param>
<param>
<key>freq_tune</key>
<value>freq_tune</value>
</param>
<param>
<key>workdir</key>
<value>/user/wire2/richter/data/</value>
</param>
<param>
<key>writeDB</key>
<value>True</value>
</param>
</block>
<block>
<key>multirds_tmc_parser</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>debug</key>
<value>False</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(1880, 512)</value>
</param>
<param>
<key>gui_hint</key>
<value>tabs@1</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>multirds_tmc_parser_0</value>
</param>
<param>
<key>label</key>
<value></value>
</param>
<param>
<key>log</key>
<value>False</value>
</param>
<param>
<key>maxheight</key>
<value>0</value>
</param>
<param>
<key>workdir</key>
<value>/user/wire2/richter/data/</value>
</param>
<param>
<key>writeDB</key>
<value>True</value>
</param>
</block>
<block> <block>
<key>osmosdr_source</key> <key>osmosdr_source</key>
<param> <param>
@ -6772,12 +6772,6 @@ class blk(gr.sync_block): # other base classes are basic_block, decim_block, in
<source_key>0</source_key> <source_key>0</source_key>
<sink_key>0</sink_key> <sink_key>0</sink_key>
</connection> </connection>
<connection>
<source_block_id>multirds_rds_parser_table_qt_0_0</source_block_id>
<sink_block_id>multirds_tmc_parser_0</sink_block_id>
<source_key>tmc_raw</source_key>
<sink_key>in</sink_key>
</connection>
<connection> <connection>
<source_block_id>epy_block_0</source_block_id> <source_block_id>epy_block_0</source_block_id>
<sink_block_id>multirds_rds_parser_table_qt_0_0</sink_block_id> <sink_block_id>multirds_rds_parser_table_qt_0_0</sink_block_id>
@ -7072,6 +7066,12 @@ class blk(gr.sync_block): # other base classes are basic_block, decim_block, in
<source_key>rds</source_key> <source_key>rds</source_key>
<sink_key>in8</sink_key> <sink_key>in8</sink_key>
</connection> </connection>
<connection>
<source_block_id>multirds_rds_parser_table_qt_0_0</source_block_id>
<sink_block_id>multirds_tmc_parser_0</sink_block_id>
<source_key>tmc_raw</source_key>
<sink_key>in</sink_key>
</connection>
<connection> <connection>
<source_block_id>osmosdr_source_0</source_block_id> <source_block_id>osmosdr_source_0</source_block_id>
<sink_block_id>blocks_stream_to_vector_0</sink_block_id> <sink_block_id>blocks_stream_to_vector_0</sink_block_id>

18
cmake/Modules/multirdsConfig.cmake

@ -1,21 +1,21 @@
INCLUDE(FindPkgConfig) INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PC_CRFA multirds) PKG_CHECK_MODULES(PC_MULTIRDS multirds)
FIND_PATH( FIND_PATH(
CRFA_INCLUDE_DIRS MULTIRDS_INCLUDE_DIRS
NAMES multirds/api.h NAMES multirds/api.h
HINTS $ENV{CRFA_DIR}/include HINTS $ENV{MULTIRDS_DIR}/include
${PC_CRFA_INCLUDEDIR} ${PC_MULTIRDS_INCLUDEDIR}
PATHS ${CMAKE_INSTALL_PREFIX}/include PATHS ${CMAKE_INSTALL_PREFIX}/include
/usr/local/include /usr/local/include
/usr/include /usr/include
) )
FIND_LIBRARY( FIND_LIBRARY(
CRFA_LIBRARIES MULTIRDS_LIBRARIES
NAMES gnuradio-multirds NAMES gnuradio-multirds
HINTS $ENV{CRFA_DIR}/lib HINTS $ENV{MULTIRDS_DIR}/lib
${PC_CRFA_LIBDIR} ${PC_MULTIRDS_LIBDIR}
PATHS ${CMAKE_INSTALL_PREFIX}/lib PATHS ${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/lib64 ${CMAKE_INSTALL_PREFIX}/lib64
/usr/local/lib /usr/local/lib
@ -25,6 +25,6 @@ FIND_LIBRARY(
) )
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CRFA DEFAULT_MSG CRFA_LIBRARIES CRFA_INCLUDE_DIRS) FIND_PACKAGE_HANDLE_STANDARD_ARGS(MULTIRDS DEFAULT_MSG MULTIRDS_LIBRARIES MULTIRDS_INCLUDE_DIRS)
MARK_AS_ADVANCED(CRFA_LIBRARIES CRFA_INCLUDE_DIRS) MARK_AS_ADVANCED(MULTIRDS_LIBRARIES MULTIRDS_INCLUDE_DIRS)

2
docs/doxygen/Doxyfile.in

@ -28,7 +28,7 @@ DOXYFILE_ENCODING = UTF-8
# identify the project. Note that if you do not use Doxywizard you need # identify the project. Note that if you do not use Doxywizard you need
# to put quotes around the project name if it contains spaces. # to put quotes around the project name if it contains spaces.
PROJECT_NAME = "GNU Radio's CRFA Package" PROJECT_NAME = "GNU Radio's MULTIRDS Package"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. # The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or # This could be handy for archiving the generated documentation or

4
docs/doxygen/other/group_defs.dox

@ -1,6 +1,6 @@
/*! /*!
* \defgroup block GNU Radio CRFA C++ Signal Processing Blocks * \defgroup block GNU Radio MULTIRDS C++ Signal Processing Blocks
* \brief All C++ blocks that can be used from the CRFA GNU Radio * \brief All C++ blocks that can be used from the MULTIRDS GNU Radio
* module are listed here or in the subcategories below. * module are listed here or in the subcategories below.
* *
*/ */

4
docs/doxygen/other/main_page.dox

@ -1,8 +1,8 @@
/*! \mainpage /*! \mainpage
Welcome to the GNU Radio CRFA Block Welcome to the GNU Radio MULTIRDS Block
This is the intro page for the Doxygen manual generated for the CRFA This is the intro page for the Doxygen manual generated for the MULTIRDS
block (docs/doxygen/other/main_page.dox). Edit it to add more detailed block (docs/doxygen/other/main_page.dox). Edit it to add more detailed
documentation about the new GNU Radio modules contained in this documentation about the new GNU Radio modules contained in this
project. project.

3
grc/CMakeLists.txt

@ -30,5 +30,6 @@ install(FILES
multirds_qtgui_range.xml multirds_qtgui_range.xml
multirds_variable_setter.xml multirds_variable_setter.xml
multirds_tmc_parser.xml multirds_tmc_parser.xml
multirds_pilot_SNR.xml DESTINATION share/gnuradio/grc/blocks multirds_pilot_SNR.xml
multirds_stream_router.xml DESTINATION share/gnuradio/grc/blocks
) )

3
include/multirds/CMakeLists.txt

@ -24,5 +24,6 @@ install(FILES
api.h api.h
rds_decoder.h rds_decoder.h
sync_decim.h sync_decim.h
rds_decoder_redsea.h DESTINATION include/multirds rds_decoder_redsea.h
stream_router.h DESTINATION include/multirds
) )

10
include/multirds/api.h

@ -19,15 +19,15 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef INCLUDED_CRFA_API_H #ifndef INCLUDED_MULTIRDS_API_H
#define INCLUDED_CRFA_API_H #define INCLUDED_MULTIRDS_API_H
#include <gnuradio/attributes.h> #include <gnuradio/attributes.h>
#ifdef gnuradio_multirds_EXPORTS #ifdef gnuradio_multirds_EXPORTS
# define CRFA_API __GR_ATTR_EXPORT # define MULTIRDS_API __GR_ATTR_EXPORT
#else #else
# define CRFA_API __GR_ATTR_IMPORT # define MULTIRDS_API __GR_ATTR_IMPORT
#endif #endif
#endif /* INCLUDED_CRFA_API_H */ #endif /* INCLUDED_MULTIRDS_API_H */

8
include/multirds/rds_decoder.h

@ -19,8 +19,8 @@
*/ */
#ifndef INCLUDED_CRFA_RDS_DECODER_H #ifndef INCLUDED_MULTIRDS_RDS_DECODER_H
#define INCLUDED_CRFA_RDS_DECODER_H #define INCLUDED_MULTIRDS_RDS_DECODER_H
#include <multirds/api.h> #include <multirds/api.h>
#include <gnuradio/sync_block.h> #include <gnuradio/sync_block.h>
@ -33,7 +33,7 @@ namespace gr {
* \ingroup multirds * \ingroup multirds
* *
*/ */
class CRFA_API rds_decoder : virtual public gr::sync_block class MULTIRDS_API rds_decoder : virtual public gr::sync_block
{ {
public: public:
typedef boost::shared_ptr<rds_decoder> sptr; typedef boost::shared_ptr<rds_decoder> sptr;
@ -52,5 +52,5 @@ namespace gr {
} // namespace multirds } // namespace multirds
} // namespace gr } // namespace gr
#endif /* INCLUDED_CRFA_RDS_DECODER_H */ #endif /* INCLUDED_MULTIRDS_RDS_DECODER_H */

8
include/multirds/rds_decoder_redsea.h

@ -19,8 +19,8 @@
*/ */
#ifndef INCLUDED_CRFA_RDS_DECODER_REDSEA_H #ifndef INCLUDED_MULTIRDS_RDS_DECODER_REDSEA_H
#define INCLUDED_CRFA_RDS_DECODER_REDSEA_H #define INCLUDED_MULTIRDS_RDS_DECODER_REDSEA_H
#include <multirds/api.h> #include <multirds/api.h>
#include <gnuradio/sync_block.h> #include <gnuradio/sync_block.h>
@ -33,7 +33,7 @@ namespace gr {
* \ingroup multirds * \ingroup multirds
* *
*/ */
class CRFA_API rds_decoder_redsea : virtual public gr::sync_block class MULTIRDS_API rds_decoder_redsea : virtual public gr::sync_block
{ {
public: public:
typedef boost::shared_ptr<rds_decoder_redsea> sptr; typedef boost::shared_ptr<rds_decoder_redsea> sptr;
@ -52,5 +52,5 @@ namespace gr {
} // namespace multirds } // namespace multirds
} // namespace gr } // namespace gr
#endif /* INCLUDED_CRFA_RDS_DECODER_REDSEA_H */ #endif /* INCLUDED_MULTIRDS_RDS_DECODER_REDSEA_H */

8
include/multirds/sync_decim.h

@ -19,8 +19,8 @@
*/ */
#ifndef INCLUDED_CRFA_SYNC_DECIM_H #ifndef INCLUDED_MULTIRDS_SYNC_DECIM_H
#define INCLUDED_CRFA_SYNC_DECIM_H #define INCLUDED_MULTIRDS_SYNC_DECIM_H
#include <multirds/api.h> #include <multirds/api.h>
#include <gnuradio/sync_decimator.h> #include <gnuradio/sync_decimator.h>
@ -33,7 +33,7 @@ namespace gr {
* \ingroup multirds * \ingroup multirds
* *
*/ */
class CRFA_API sync_decim : virtual public gr::sync_decimator class MULTIRDS_API sync_decim : virtual public gr::sync_decimator
{ {
public: public:
typedef boost::shared_ptr<sync_decim> sptr; typedef boost::shared_ptr<sync_decim> sptr;
@ -52,5 +52,5 @@ namespace gr {
} // namespace multirds } // namespace multirds
} // namespace gr } // namespace gr
#endif /* INCLUDED_CRFA_SYNC_DECIM_H */ #endif /* INCLUDED_MULTIRDS_SYNC_DECIM_H */

3
lib/CMakeLists.txt

@ -27,7 +27,8 @@ link_directories(${Boost_LIBRARY_DIRS})
list(APPEND multirds_sources list(APPEND multirds_sources
rds_decoder_impl.cc rds_decoder_impl.cc
sync_decim_impl.cc sync_decim_impl.cc
rds_decoder_redsea_impl.cc ) rds_decoder_redsea_impl.cc
stream_router_impl.cc )
set(multirds_sources "${multirds_sources}" PARENT_SCOPE) set(multirds_sources "${multirds_sources}" PARENT_SCOPE)
if(NOT multirds_sources) if(NOT multirds_sources)

2
lib/constants.h

@ -27,7 +27,7 @@ static const unsigned int offset_word[5]={252,408,360,436,848};
static const unsigned int syndrome[5]={383,14,303,663,748}; static const unsigned int syndrome[5]={383,14,303,663,748};
//static const char * const offset_name[]={"A","B","C","D","C'"}; //static const char * const offset_name[]={"A","B","C","D","C'"};
static const char offset_name[]={'A','B','C','D','c'}; static const char offset_name[]={'A','B','C','D','c'};
static const char expected_offset_char[]={'A','B','X','D'}; static const char expected_offset_char[]={'A','B','?','D'};
/* Annex F of RBDS Standard Table F.1 (North America) and /* Annex F of RBDS Standard Table F.1 (North America) and
* Table F.2 (Europe) */ * Table F.2 (Europe) */

6
lib/qa_multirds.h

@ -20,8 +20,8 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef _QA_CRFA_H_ #ifndef _QA_MULTIRDS_H_
#define _QA_CRFA_H_ #define _QA_MULTIRDS_H_
#include <gnuradio/attributes.h> #include <gnuradio/attributes.h>
#include <cppunit/TestSuite.h> #include <cppunit/TestSuite.h>
@ -35,4 +35,4 @@ class __GR_ATTR_EXPORT qa_multirds
static CppUnit::TestSuite *suite(); static CppUnit::TestSuite *suite();
}; };
#endif /* _QA_CRFA_H_ */ #endif /* _QA_MULTIRDS_H_ */

6
lib/rds_decoder_impl.h

@ -18,8 +18,8 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef INCLUDED_CRFA_RDS_DECODER_IMPL_H #ifndef INCLUDED_MULTIRDS_RDS_DECODER_IMPL_H
#define INCLUDED_CRFA_RDS_DECODER_IMPL_H #define INCLUDED_MULTIRDS_RDS_DECODER_IMPL_H
#include <multirds/rds_decoder.h> #include <multirds/rds_decoder.h>
@ -75,5 +75,5 @@ private:
} // namespace multirds } // namespace multirds
} // namespace gr } // namespace gr
#endif /* INCLUDED_CRFA_RDS_DECODER_IMPL_H */ #endif /* INCLUDED_MULTIRDS_RDS_DECODER_IMPL_H */

45
lib/rds_decoder_redsea_impl.cc

@ -136,7 +136,8 @@ static const char * const offset_name[]={"A","B","C","D","c"};*/
// bits." // bits."
// Kopitz & Marks 1999: "RDS: The Radio Data System", p. 224 // Kopitz & Marks 1999: "RDS: The Radio Data System", p. 224
//for (uint32_t e=0x1;e <= 0x3;e+=0x2) {//for (uint32_t e : {0x1, 0x3}) { //for (uint32_t e=0x1;e <= 0x3;e+=0x2) {//for (uint32_t e : {0x1, 0x3}) {
for (uint32_t e : {0x1, 0x3, 0x7,0x15,0x31}) {//fix up to 5 bit burst errors //for (uint32_t e : {0x1, 0x3, 0x7,0x15,0x31}) {//fix up to 5 bit burst errors (as code should support)
for (uint32_t e : {0x1, 0x3}) {//fix up to 2 bit burst errors (as book says)
for (int shift=0; shift < 26; shift++) { for (int shift=0; shift < 26; shift++) {
uint32_t errvec = ((e << shift) & kBitmask26); uint32_t errvec = ((e << shift) & kBitmask26);
uint16_t sy = calc_syndrome(errvec ^ offset_word[offset_num],26); uint16_t sy = calc_syndrome(errvec ^ offset_word[offset_num],26);
@ -204,6 +205,7 @@ int rds_decoder_redsea_impl::work (int noutput_items,
uint16_t block_calculated_crc, block_received_crc, checkword,dataword; uint16_t block_calculated_crc, block_received_crc, checkword,dataword;
uint16_t reg_syndrome; uint16_t reg_syndrome;
uint8_t offset_char('x'); // x = error while decoding the word offset uint8_t offset_char('x'); // x = error while decoding the word offset
uint8_t variant;
/* the synchronization process is described in Annex C, page 66 of the standard */ /* the synchronization process is described in Annex C, page 66 of the standard */
while (i<noutput_items) { while (i<noutput_items) {
@ -245,13 +247,40 @@ int rds_decoder_redsea_impl::work (int noutput_items,
checkword=reg & 0x3ff;//checkword part of received block (lower 10 bits) checkword=reg & 0x3ff;//checkword part of received block (lower 10 bits)
/* manage special case of C or C' offset word */ /* manage special case of C or C' offset word */
if (block_number==2) { if (block_number==2) {
block_received_crc=checkword^offset_word[block_number]; if (variant==0){//A
offset_char = 'C';
block_received_crc=checkword^offset_word[2];
}
else{//B
offset_char = 'c';
block_received_crc=checkword^offset_word[4];
}
if (block_received_crc==block_calculated_crc) {
good_block=true;
}else{
//try correcting:
uint32_t corrected_block= correctBurstErrors(reg,offset_char);
if(corrected_block != reg){
good_block=true;
dataword=(corrected_block>>10) & 0xffff;
checkword=corrected_block & 0x3ff;
//dout << "corrected error"<<std::endl;
}else {
wrong_blocks_counter++;
good_block=false;
}
}
/*block_received_crc=checkword^offset_word[block_number];
if (block_received_crc==block_calculated_crc) { if (block_received_crc==block_calculated_crc) {
good_block=true; good_block=true;
offset_char = 'C'; offset_char = 'C';
} else { } else {
//try correcting: //try correcting:
uint32_t corrected_block= correctBurstErrors(reg,'C');
//uint32_t corrected_block= correctBurstErrors(reg,'C');
uint32_t corrected_block = reg;//2017-04-24 disabled correction for third block
//-> errors if corrected with wrong offset
if(corrected_block != reg){ if(corrected_block != reg){
good_block=true; good_block=true;
dataword=(corrected_block>>10) & 0xffff; dataword=(corrected_block>>10) & 0xffff;
@ -269,15 +298,16 @@ int rds_decoder_redsea_impl::work (int noutput_items,
good_block=false; good_block=false;
} }
} }
} }*/
} }
else { else {
block_received_crc=checkword^offset_word[block_number]; block_received_crc=checkword^offset_word[block_number];
if (block_received_crc==block_calculated_crc) { if (block_received_crc==block_calculated_crc) {
good_block=true; good_block=true;
if (block_number==0) offset_char = 'A'; offset_char=expected_offset_char[block_number]; //expected_offset_char[]={'A','B','?','D'};
/*if (block_number==0) offset_char = 'A';
else if (block_number==1) offset_char = 'B'; else if (block_number==1) offset_char = 'B';
else if (block_number==3) offset_char = 'D'; else if (block_number==3) offset_char = 'D';*/
} else { } else {
//try correcting: //try correcting:
uint32_t corrected_block= correctBurstErrors(reg,expected_offset_char[block_number]); uint32_t corrected_block= correctBurstErrors(reg,expected_offset_char[block_number]);
@ -304,6 +334,9 @@ int rds_decoder_redsea_impl::work (int noutput_items,
group_assembly_started=true; group_assembly_started=true;
group_good_blocks_counter=1; group_good_blocks_counter=1;
} }
if (block_number==1 && good_block) {//2nd block - > read group type variant
variant=(dataword>>12)& 0x1;
}
if (group_assembly_started) { if (group_assembly_started) {
if (!good_block) group_assembly_started=false; if (!good_block) group_assembly_started=false;
else { else {

6
lib/rds_decoder_redsea_impl.h

@ -18,8 +18,8 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef INCLUDED_CRFA_RDS_DECODER_IMPL_H #ifndef INCLUDED_MULTIRDS_RDS_DECODER_IMPL_H
#define INCLUDED_CRFA_RDS_DECODER_IMPL_H #define INCLUDED_MULTIRDS_RDS_DECODER_IMPL_H
#include <multirds/rds_decoder_redsea.h> #include <multirds/rds_decoder_redsea.h>
@ -77,5 +77,5 @@ private:
} // namespace multirds } // namespace multirds
} // namespace gr } // namespace gr
#endif /* INCLUDED_CRFA_RDS_DECODER_IMPL_H */ #endif /* INCLUDED_MULTIRDS_RDS_DECODER_IMPL_H */

3
lib/sync_decim_impl.cc

@ -26,7 +26,8 @@
#include "sync_decim_impl.h" #include "sync_decim_impl.h"
#define DECIM 2 #define DECIM 2
#define lout log && std::cout #define lout log && std::cout
#define SYNC_COUNTER_MAX 5//higher value -> slower sync, less cpu load //#define SYNC_COUNTER_MAX 5//higher value -> slower sync, less cpu load
#define SYNC_COUNTER_MAX 7//higher value -> slower sync, less cpu load
//#include <pmt.h> //#include <pmt.h>
namespace gr { namespace gr {
namespace multirds { namespace multirds {

6
lib/sync_decim_impl.h

@ -18,8 +18,8 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef INCLUDED_CRFA_SYNC_DECIM_IMPL_H #ifndef INCLUDED_MULTIRDS_SYNC_DECIM_IMPL_H
#define INCLUDED_CRFA_SYNC_DECIM_IMPL_H #define INCLUDED_MULTIRDS_SYNC_DECIM_IMPL_H
#include <multirds/sync_decim.h> #include <multirds/sync_decim.h>
@ -52,5 +52,5 @@ namespace gr {
} // namespace multirds } // namespace multirds
} // namespace gr } // namespace gr
#endif /* INCLUDED_CRFA_SYNC_DECIM_IMPL_H */ #endif /* INCLUDED_MULTIRDS_SYNC_DECIM_IMPL_H */

2
python/__init__.py

@ -19,7 +19,7 @@
# The presence of this file turns this directory into a Python package # The presence of this file turns this directory into a Python package
''' '''
This is the GNU Radio CRFA module. Place your Python package This is the GNU Radio MULTIRDS module. Place your Python package
description here (python/__init__.py). description here (python/__init__.py).
''' '''

2
python/rds_parser_table_qt.py

@ -616,7 +616,7 @@ class rds_parser_table_qt(gr.sync_block):#START
#decode 3A group of RT+ #decode 3A group of RT+
if AID==19415: #RT+ if AID==19415: #RT+
self.RDS_data[PI]["AID_list"][AID]["CB"]=(app_data>>12)&0x1 #is set if template available self.RDS_data[PI]["AID_list"][AID]["CB"]=(app_data>>12)&0x1 #is set if template available
self.RDS_data[PI]["AID_list"][AID]["SCB"]=(app_data >> 8)&0x0f#server control bit self.RDS_data[PI]["AID_list"][AID]["SCB"]=(app_data >> 8)&0x0f#server control bits
self.RDS_data[PI]["AID_list"][AID]["template_number"]=app_data&0xff self.RDS_data[PI]["AID_list"][AID]["template_number"]=app_data&0xff
#decode 3A group of TMC #decode 3A group of TMC
if AID==52550:#TMC alert-c (continuously update) if AID==52550:#TMC alert-c (continuously update)

5
swig/multirds_swig.i

@ -1,6 +1,6 @@
/* -*- c++ -*- */ /* -*- c++ -*- */
#define CRFA_API #define MULTIRDS_API
%include "gnuradio.i" // the common stuff %include "gnuradio.i" // the common stuff
@ -11,6 +11,7 @@
#include "multirds/rds_decoder.h" #include "multirds/rds_decoder.h"
#include "multirds/sync_decim.h" #include "multirds/sync_decim.h"
#include "multirds/rds_decoder_redsea.h" #include "multirds/rds_decoder_redsea.h"
#include "multirds/stream_router.h"
%} %}
%include "multirds/rds_decoder.h" %include "multirds/rds_decoder.h"
@ -20,3 +21,5 @@ GR_SWIG_BLOCK_MAGIC2(multirds, rds_decoder);
GR_SWIG_BLOCK_MAGIC2(multirds, sync_decim); GR_SWIG_BLOCK_MAGIC2(multirds, sync_decim);
%include "multirds/rds_decoder_redsea.h" %include "multirds/rds_decoder_redsea.h"
GR_SWIG_BLOCK_MAGIC2(multirds, rds_decoder_redsea); GR_SWIG_BLOCK_MAGIC2(multirds, rds_decoder_redsea);
%include "multirds/stream_router.h"
GR_SWIG_BLOCK_MAGIC2(multirds, stream_router);

Loading…
Cancel
Save