SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Private Attributes | List of all members
SymbolSynchronizer Class Reference

#include <symsync.h>

Public Member Functions

 SymbolSynchronizer ()
 
 ~SymbolSynchronizer ()
 
Real run (const Sample &s)
 
liquid_float_complex runZ (const Sample &s)
 

Private Attributes

symsync_crcf m_sync
 
liquid_float_complex m_z [4+4]
 
liquid_float_complex m_z0
 
int m_syncSampleCount
 

Detailed Description

Definition at line 25 of file symsync.h.

Constructor & Destructor Documentation

◆ SymbolSynchronizer()

SymbolSynchronizer::SymbolSynchronizer ( )

Definition at line 23 of file symsync.cpp.

References m_sync, and m_syncSampleCount.

24 {
25  // For now use hardcoded values:
26  // - RRC filter
27  // - 4 samples per symbol
28  // - 5 symbols delay filter
29  // - 0.5 filter excess bandwidth factor
30  // - 32 filter elements for the internal polyphase filter
31  m_sync = symsync_crcf_create_rnyquist(LIQUID_FIRFILT_RRC, 4, 5, 0.5f, 32);
32  // - 0.02 loop filter bandwidth factor
33  symsync_crcf_set_lf_bw(m_sync, 0.01f);
34  // - 4 samples per symbol output rate
35  symsync_crcf_set_output_rate(m_sync, 4);
37 }
int m_syncSampleCount
Definition: symsync.h:38
symsync_crcf m_sync
Definition: symsync.h:35

◆ ~SymbolSynchronizer()

SymbolSynchronizer::~SymbolSynchronizer ( )

Definition at line 39 of file symsync.cpp.

References m_sync.

40 {
41  symsync_crcf_destroy(m_sync);
42 }
symsync_crcf m_sync
Definition: symsync.h:35

Member Function Documentation

◆ run()

Real SymbolSynchronizer::run ( const Sample s)

Definition at line 44 of file symsync.cpp.

References i, Sample::m_imag, Sample::m_real, m_sync, m_syncSampleCount, m_z, and SDR_RX_SCALEF.

45 {
46  unsigned int nn;
47  Real v = -1.0f;
48  liquid_float_complex y = (s.m_real / SDR_RX_SCALEF) + (s.m_imag / SDR_RX_SCALEF)*I;
49  symsync_crcf_execute(m_sync, &y, 1, m_z, &nn);
50 
51  for (unsigned int i = 0; i < nn; i++)
52  {
53  if (nn != 1) {
54  qDebug("SymbolSynchronizer::run: %u", nn);
55  }
56 
57  if (m_syncSampleCount % 4 == 0) {
58  v = 1.0f;
59  }
60 
61  if (m_syncSampleCount < 4095) {
63  } else {
64  qDebug("SymbolSynchronizer::run: tau: %f", symsync_crcf_get_tau(m_sync));
66  }
67  }
68 
69  return v;
70 }
liquid_float_complex m_z[4+4]
Definition: symsync.h:36
#define SDR_RX_SCALEF
Definition: dsptypes.h:33
FixReal m_real
Definition: dsptypes.h:64
int32_t i
Definition: decimators.h:244
int m_syncSampleCount
Definition: symsync.h:38
symsync_crcf m_sync
Definition: symsync.h:35
FixReal m_imag
Definition: dsptypes.h:65
float Real
Definition: dsptypes.h:42

◆ runZ()

liquid_float_complex SymbolSynchronizer::runZ ( const Sample s)

Definition at line 72 of file symsync.cpp.

References i, Sample::m_imag, Sample::m_real, m_sync, m_syncSampleCount, m_z, m_z0, and SDR_RX_SCALEF.

73 {
74  unsigned int nn;
75  liquid_float_complex y = (s.m_real / SDR_RX_SCALEF) + (s.m_imag / SDR_RX_SCALEF)*I;
76  symsync_crcf_execute(m_sync, &y, 1, m_z, &nn);
77 
78  for (unsigned int i = 0; i < nn; i++)
79  {
80  if (nn != 1) {
81  qDebug("SymbolSynchronizer::run: %u", nn);
82  }
83 
84  if (m_syncSampleCount == 0) {
85  m_z0 = m_z[i];
86  }
87 
88  if (m_syncSampleCount < 3) {
90  } else {
92  }
93  }
94 
95  return m_z0;
96 }
liquid_float_complex m_z[4+4]
Definition: symsync.h:36
#define SDR_RX_SCALEF
Definition: dsptypes.h:33
FixReal m_real
Definition: dsptypes.h:64
int32_t i
Definition: decimators.h:244
int m_syncSampleCount
Definition: symsync.h:38
symsync_crcf m_sync
Definition: symsync.h:35
liquid_float_complex m_z0
Definition: symsync.h:37
FixReal m_imag
Definition: dsptypes.h:65

Member Data Documentation

◆ m_sync

symsync_crcf SymbolSynchronizer::m_sync
private

Definition at line 35 of file symsync.h.

Referenced by run(), runZ(), SymbolSynchronizer(), and ~SymbolSynchronizer().

◆ m_syncSampleCount

int SymbolSynchronizer::m_syncSampleCount
private

Definition at line 38 of file symsync.h.

Referenced by run(), runZ(), and SymbolSynchronizer().

◆ m_z

liquid_float_complex SymbolSynchronizer::m_z[4+4]
private

Definition at line 36 of file symsync.h.

Referenced by run(), and runZ().

◆ m_z0

liquid_float_complex SymbolSynchronizer::m_z0
private

Definition at line 37 of file symsync.h.

Referenced by runZ().


The documentation for this class was generated from the following files: