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.
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
leansdr::s2_frame_receiver< T, SOFTSYMB > Struct Template Reference

#include <dvbs2.h>

+ Inheritance diagram for leansdr::s2_frame_receiver< T, SOFTSYMB >:
+ Collaboration diagram for leansdr::s2_frame_receiver< T, SOFTSYMB >:

Classes

struct  sampler_state
 
struct  sync
 

Public Types

enum  { COARSE_FREQ, FRAME_SEARCH, FRAME_LOCKED }
 

Public Member Functions

 s2_frame_receiver (scheduler *sch, sampler_interface< T > *_sampler, pipebuf< complex< T >> &_in, pipebuf< plslot< SOFTSYMB >> &_out, pipebuf< float > *_freq_out=NULL, pipebuf< float > *_ss_out=NULL, pipebuf< float > *_mer_out=NULL, pipebuf< complex< float >> *_cstln_out=NULL, pipebuf< complex< float >> *_cstln_pls_out=NULL, pipebuf< complex< float >> *_symbols_out=NULL, pipebuf< int > *_state_out=NULL)
 
void run ()
 
void init_coarse_freq ()
 
void enter_coarse_freq ()
 
void run_frame_coarse ()
 
void enter_frame_search ()
 
void run_frame_search ()
 
void enter_frame_locked ()
 
void run_frame_locked ()
 
void shutdown ()
 
void init_agc (const complex< T > *buf, int n)
 
void track_agc (const complex< float > &p)
 
void update_agc ()
 
complex< float > descramble (sampler_state *ss, const complex< float > &p)
 
complex< float > interp_next (sampler_state *ss)
 
void align_phase (sampler_state *ss, const complex< float > &c)
 
uint8_t track_symbol (sampler_state *ss, const complex< float > &p, cstln_lut< SOFTSYMB, 256 > *c, int mode)
 
void add_syncs (cstln_lut< SOFTSYMB, 256 > *c)
 
- Public Member Functions inherited from leansdr::runnable
 runnable (scheduler *_sch, const char *name)
 
- Public Member Functions inherited from leansdr::runnable_common
 runnable_common (const char *_name)
 
virtual ~runnable_common ()
 

Public Attributes

sampler_interface< T > * sampler
 
int meas_decimation
 
float Ftune
 
float Fm
 
bool strongpls
 
enum leansdr::s2_frame_receiver:: { ... }  state
 
float min_freqw16
 
float max_freqw16
 
complex< float > diffcorr
 
int coarse_count
 
float freqw16
 
float phase16
 
float mu
 
float omega
 
struct {
   complex< float >   p
 
   complex< float >   c
 
hist [3]
 
float in_power
 
float ev_power
 
float agc_gain
 
float agc_bw
 
cstln_lut< SOFTSYMB, 256 > * qpsk
 
struct leansdr::s2_frame_receiver::sync syncs [MAXSYNCS]
 
struct leansdr::s2_frame_receiver::synccurrent_sync [MAXSYNCS]
 
int nsyncs
 
s2_plscodes< T > plscodes
 
cstln_lut< SOFTSYMB, 256 > * cstln
 
trig16 trig
 
modcod_infomcinfo
 
pipereader< complex< T > > in
 
pipewriter< plslot< SOFTSYMB > > out
 
int meas_count
 
pipewriter< float > * freq_out
 
pipewriter< float > * ss_out
 
pipewriter< float > * mer_out
 
pipewriter< complex< float > > * cstln_out
 
pipewriter< complex< float > > * cstln_pls_out
 
pipewriter< complex< float > > * symbols_out
 
pipewriter< int > * state_out
 
bool report_state
 
s2_scrambling scrambling
 
s2_sof< T > sof
 
int m_modcodType
 
int m_modcodRate
 
- Public Attributes inherited from leansdr::runnable_common
const char * name
 

Static Public Attributes

static const int MAX_SYMBOLS_PER_FRAME
 
static const int MAXSYNCS = 8
 
static const int MAX_SLOTS = 240
 
static const int MAX_SYMBOLS
 

Additional Inherited Members

- Protected Attributes inherited from leansdr::runnable
schedulersch
 

Detailed Description

template<typename T, typename SOFTSYMB>
struct leansdr::s2_frame_receiver< T, SOFTSYMB >

Definition at line 436 of file dvbs2.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename T, typename SOFTSYMB>
anonymous enum
Enumerator
COARSE_FREQ 
FRAME_SEARCH 
FRAME_LOCKED 

Definition at line 490 of file dvbs2.h.

Constructor & Destructor Documentation

◆ s2_frame_receiver()

template<typename T, typename SOFTSYMB>
leansdr::s2_frame_receiver< T, SOFTSYMB >::s2_frame_receiver ( scheduler sch,
sampler_interface< T > *  _sampler,
pipebuf< complex< T >> &  _in,
pipebuf< plslot< SOFTSYMB >> &  _out,
pipebuf< float > *  _freq_out = NULL,
pipebuf< float > *  _ss_out = NULL,
pipebuf< float > *  _mer_out = NULL,
pipebuf< complex< float >> *  _cstln_out = NULL,
pipebuf< complex< float >> *  _cstln_pls_out = NULL,
pipebuf< complex< float >> *  _symbols_out = NULL,
pipebuf< int > *  _state_out = NULL 
)
inline

Definition at line 446 of file dvbs2.h.

References leansdr::cstln_base::QPSK.

457  : runnable(sch, "S2 frame receiver"),
458  sampler(_sampler),
459  meas_decimation(1048576),
460  Ftune(0), Fm(0),
461  strongpls(false),
462  in_power(0), ev_power(0), agc_gain(1), agc_bw(1e-3),
463  nsyncs(0),
464  cstln(NULL),
465  in(_in), out(_out, 1 + modcod_info::MAX_SLOTS_PER_FRAME),
466  meas_count(0),
467  freq_out(opt_writer(_freq_out)),
468  ss_out(opt_writer(_ss_out)),
469  mer_out(opt_writer(_mer_out)),
470  cstln_out(opt_writer(_cstln_out, 1024)),
471  cstln_pls_out(opt_writer(_cstln_pls_out, 1024)),
473  state_out(opt_writer(_state_out)),
474  report_state(false),
475  scrambling(0),
476  m_modcodType(-1),
477  m_modcodRate(-1)
478  {
479  // Constellation for PLS
480  qpsk = new cstln_lut<SOFTSYMB, 256>(cstln_base::QPSK);
481  add_syncs(qpsk);
482 
484 
485 #if TEST_DIVERSITY
486  fprintf(stderr, "** DEBUG: Diversity test mode (slower)\n");
487 #endif
488  }
pipewriter< float > * freq_out
Definition: dvbs2.h:1199
pipewriter< complex< float > > * symbols_out
Definition: dvbs2.h:1202
static const int MAX_SLOTS_PER_FRAME
Definition: dvbs2.h:222
void add_syncs(cstln_lut< SOFTSYMB, 256 > *c)
Definition: dvbs2.h:1155
runnable(scheduler *_sch, const char *name)
Definition: framework.h:193
static const int MAX_SYMBOLS_PER_FRAME
Definition: dvbs2.h:443
s2_scrambling scrambling
Definition: dvbs2.h:1206
cstln_lut< SOFTSYMB, 256 > * qpsk
Definition: dvbs2.h:1142
cstln_lut< SOFTSYMB, 256 > * cstln
Definition: dvbs2.h:1153
pipewriter< int > * state_out
Definition: dvbs2.h:1203
pipewriter< complex< float > > * cstln_pls_out
Definition: dvbs2.h:1201
pipewriter< plslot< SOFTSYMB > > out
Definition: dvbs2.h:1197
pipewriter< T > * opt_writer(pipebuf< T > *buf, unsigned long min_write=1)
Definition: framework.h:329
pipereader< complex< T > > in
Definition: dvbs2.h:1196
scheduler * sch
Definition: framework.h:199
pipewriter< float > * ss_out
Definition: dvbs2.h:1199
sampler_interface< T > * sampler
Definition: dvbs2.h:438
pipewriter< complex< float > > * cstln_out
Definition: dvbs2.h:1200
pipewriter< float > * mer_out
Definition: dvbs2.h:1199

Member Function Documentation

◆ add_syncs()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::add_syncs ( cstln_lut< SOFTSYMB, 256 > *  c)
inline

Definition at line 1155 of file dvbs2.h.

References leansdr::fail(), leansdr::s2_frame_receiver< T, SOFTSYMB >::sync::hist, i, leansdr::complex< T >::im, M_PI, leansdr::cstln_base::nrotations, leansdr::cstln_base::nsymbols, leansdr::s2_frame_receiver< T, SOFTSYMB >::sync::offset16, leansdr::complex< T >::re, leansdr::cstln_base::symbols, and leansdr::s2_frame_receiver< T, SOFTSYMB >::sync::tobpsk.

1156  {
1157  int random_decision = 0;
1158  int nrot = c->nrotations;
1159 #if 0
1160  if ( nrot == 4 ) {
1161  fprintf(stderr, "Special case for 8PSK locking as QPSK pi/8\n");
1162  nrot = 8;
1163  }
1164 #endif
1165  for (int r = 0; r < nrot; ++r)
1166  {
1167  if (nsyncs == MAXSYNCS)
1168  fail("Bug: too many syncs");
1169  sync *s = &syncs[nsyncs++];
1170  s->offset16 = 65536.0 * r / nrot;
1171  float angle = -2 * M_PI * r / nrot;
1172  s->tobpsk = 0;
1173  for (int i = c->nsymbols; i--;)
1174  {
1175  complex<int8_t> p = c->symbols[i];
1176  float re = p.re * cosf(angle) - p.im * sinf(angle);
1177  float im = p.re * sinf(angle) + p.im * cosf(angle);
1178  int bit;
1179  if (im > 1)
1180  bit = 0;
1181  else if (im < -1)
1182  bit = 1;
1183  else
1184  {
1185  bit = random_decision;
1186  random_decision ^= 1;
1187  } // Near 0
1188  s->tobpsk = (s->tobpsk << 1) | bit;
1189  }
1190  s->hist = 0;
1191  }
1192  }
complex< float > p
Definition: dvbs2.h:1134
#define M_PI
Definition: rdsdemod.cpp:27
void fail(const char *s)
Definition: framework.cpp:11
int32_t i
Definition: decimators.h:244
struct leansdr::s2_frame_receiver::sync syncs[MAXSYNCS]
complex< int8_t > * symbols
Definition: sdr.h:478
static const int MAXSYNCS
Definition: dvbs2.h:1143
+ Here is the call graph for this function:

◆ align_phase()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::align_phase ( sampler_state ss,
const complex< float > &  c 
)
inline

Definition at line 1073 of file dvbs2.h.

References leansdr::complex< T >::im, M_PI, leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::ph16, and leansdr::complex< T >::re.

1074  {
1075 #if 0
1076  // Reference implementation
1077  float err = atan2f(c.im,c.re) * (65536/(2*M_PI));
1078 #else
1079  // Same performance as atan2f, faster
1080  if (!c.re)
1081  return;
1082  float err = c.im / c.re * (65536 / (2 * M_PI));
1083 #endif
1084  ss->ph16 += err;
1085  }
#define M_PI
Definition: rdsdemod.cpp:27

◆ descramble()

template<typename T, typename SOFTSYMB>
complex<float> leansdr::s2_frame_receiver< T, SOFTSYMB >::descramble ( sampler_state ss,
const complex< float > &  p 
)
inline

Definition at line 1018 of file dvbs2.h.

References leansdr::complex< T >::im, leansdr::complex< T >::re, and leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::scr.

1019  {
1020  int r = *ss->scr++;
1021  complex<float> res;
1022  switch (r)
1023  {
1024  case 3:
1025  res.re = -p.im;
1026  res.im = p.re;
1027  break;
1028  case 2:
1029  res.re = -p.re;
1030  res.im = -p.im;
1031  break;
1032  case 1:
1033  res.re = p.im;
1034  res.im = -p.re;
1035  break;
1036  default:
1037  res = p;
1038  }
1039  return res;
1040  }
complex< float > p
Definition: dvbs2.h:1134

◆ enter_coarse_freq()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::enter_coarse_freq ( )
inline

Definition at line 556 of file dvbs2.h.

References leansdr::opt_write().

557  {
558  opt_write(state_out, 0);
560  }
void opt_write(pipewriter< T > *p, T val)
Definition: framework.h:341
pipewriter< int > * state_out
Definition: dvbs2.h:1203
+ Here is the call graph for this function:

◆ enter_frame_locked()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::enter_frame_locked ( )
inline

Definition at line 673 of file dvbs2.h.

References leansdr::opt_write().

674  {
675  opt_write(state_out, 1);
676  if (sch->debug)
677  fprintf(stderr, "LOCKED\n");
679  }
enum leansdr::s2_frame_receiver::@5 state
void opt_write(pipewriter< T > *p, T val)
Definition: framework.h:341
pipewriter< int > * state_out
Definition: dvbs2.h:1203
scheduler * sch
Definition: framework.h:199
+ Here is the call graph for this function:

◆ enter_frame_search()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::enter_frame_search ( )
inline

Definition at line 595 of file dvbs2.h.

References leansdr::opt_write().

596  {
597  opt_write(state_out, 0);
598  mu = 0;
599  phase16 = 0;
600  if (sch->debug)
601  fprintf(stderr, "ACQ\n");
603  }
enum leansdr::s2_frame_receiver::@5 state
void opt_write(pipewriter< T > *p, T val)
Definition: framework.h:341
pipewriter< int > * state_out
Definition: dvbs2.h:1203
scheduler * sch
Definition: framework.h:199
+ Here is the call graph for this function:

◆ init_agc()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::init_agc ( const complex< T > *  buf,
int  n 
)
inline

Definition at line 988 of file dvbs2.h.

References leansdr::cnorm2(), and i.

989  {
990  in_power = 0;
991  for (int i = 0; i < n; ++i)
992  in_power += cnorm2(buf[i]);
993  in_power /= n;
994  }
int32_t i
Definition: decimators.h:244
T cnorm2(const complex< T > &u)
Definition: math.h:89
+ Here is the call graph for this function:

◆ init_coarse_freq()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::init_coarse_freq ( )
inline

Definition at line 547 of file dvbs2.h.

548  {
549  diffcorr = 0;
550  coarse_count = 0;
551  memset(hist, 0, sizeof(hist));
552  state = COARSE_FREQ;
553  }
enum leansdr::s2_frame_receiver::@5 state
struct leansdr::s2_frame_receiver::@6 hist[3]
complex< float > diffcorr
Definition: dvbs2.h:500

◆ interp_next()

template<typename T, typename SOFTSYMB>
complex<float> leansdr::s2_frame_receiver< T, SOFTSYMB >::interp_next ( sampler_state ss)
inline

Definition at line 1044 of file dvbs2.h.

References leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::fw16, leansdr::sampler_interface< T >::interp(), leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::mu, leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::p, and leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::ph16.

1045  {
1046  // Skip to next sample
1047  while (ss->mu >= 1)
1048  {
1049  ++ss->p;
1050  ss->mu -= 1.0f;
1051  }
1052  // Interpolate
1053 #if 0
1054  // Interpolate linearly then derotate.
1055  // This will fail with large carrier offsets (e.g. --tune).
1056  float cmu = 1.0f - ss->mu;
1057  complex<float> s(ss->p[0].re*cmu + ss->p[1].re*ss->mu,
1058  ss->p[0].im*cmu + ss->p[1].im*ss->mu);
1059  ss->mu += omega;
1060  // Derotate
1061  const complex<float> &rot = trig.expi(-ss->ph16);
1062  ss->ph16 += ss->fw16;
1063  return rot * s;
1064 #else
1065  // Use generic interpolator
1066  complex<float> s = sampler->interp(ss->p, ss->mu, ss->ph16);
1067  ss->mu += omega;
1068  ss->ph16 += ss->fw16;
1069  return s;
1070 #endif
1071  }
const complex< float > & expi(uint16_t a) const
Definition: math.h:146
sampler_interface< T > * sampler
Definition: dvbs2.h:438
+ Here is the call graph for this function:

◆ run()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::run ( )
inlinevirtual

Reimplemented from leansdr::runnable_common.

Definition at line 510 of file dvbs2.h.

References leansdr::modcod_info::MAX_SLOTS_PER_FRAME, leansdr::opt_writable(), leansdr::opt_write(), and leansdr::sampler_interface< T >::readahead().

511  {
512  // Require enough samples to detect one plheader,
513  // TBD margin ?
514  int min_samples = (1 + MAX_SYMBOLS_PER_FRAME +
516  omega * 2;
517  while (in.readable() >= min_samples + sampler->readahead() &&
518  out.writable() >= 1 + modcod_info::MAX_SLOTS_PER_FRAME &&
519  opt_writable(freq_out, 1) &&
520  opt_writable(ss_out, 1) &&
521  opt_writable(mer_out, 1) &&
524  {
525  if (report_state)
526  {
527  // Report unlocked state on first invocation.
528  opt_write(state_out, 0);
529  report_state = false;
530  }
531  switch (state)
532  {
533  case COARSE_FREQ:
535  break;
536  case FRAME_SEARCH:
538  break;
539  case FRAME_LOCKED:
541  break;
542  }
543  }
544  }
pipewriter< float > * freq_out
Definition: dvbs2.h:1199
pipewriter< complex< float > > * symbols_out
Definition: dvbs2.h:1202
static const int MAX_SLOTS_PER_FRAME
Definition: dvbs2.h:222
enum leansdr::s2_frame_receiver::@5 state
static const int MAX_SYMBOLS_PER_FRAME
Definition: dvbs2.h:443
void opt_write(pipewriter< T > *p, T val)
Definition: framework.h:341
pipewriter< int > * state_out
Definition: dvbs2.h:1203
pipewriter< plslot< SOFTSYMB > > out
Definition: dvbs2.h:1197
bool opt_writable(pipewriter< T > *p, int n=1)
Definition: framework.h:335
pipereader< complex< T > > in
Definition: dvbs2.h:1196
static const int LENGTH
Definition: dvbs2.h:209
pipewriter< float > * ss_out
Definition: dvbs2.h:1199
sampler_interface< T > * sampler
Definition: dvbs2.h:438
pipewriter< float > * mer_out
Definition: dvbs2.h:1199
+ Here is the call graph for this function:

◆ run_frame_coarse()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::run_frame_coarse ( )
inline

Definition at line 562 of file dvbs2.h.

References leansdr::complex< T >::im, M_PI, and leansdr::complex< T >::re.

563  {
564  freqw16 = 65536 * Ftune;
565  min_freqw16 = freqw16 - 65536.0 / 9;
566  max_freqw16 = freqw16 + 65536.0 / 9;
567 
568  complex<T> *pin = in.rd();
569  complex<T> p = *pin++;
570  int nsamples = MAX_SYMBOLS_PER_FRAME * omega;
571  for (int s = nsamples; s--; ++pin)
572  {
573  complex<T> n = *pin;
574  diffcorr.re += p.re * n.re + p.im * n.im;
575  diffcorr.im += p.re * n.im - p.im * n.re;
576  p = n;
577  }
578  in.read(nsamples);
579  ++coarse_count;
580  if (coarse_count == 50)
581  {
582  float freqw = atan2f(diffcorr.im, diffcorr.re) * omega;
583  fprintf(stderr, "COARSE(%d): %f rad/symb (%.0f Hz at %.0f baud)\n",
584  coarse_count, freqw, freqw * Fm / (2 * M_PI), Fm);
585 #if 0
586  freqw16 = freqw * 65536 / (2*M_PI);
587 #else
588  fprintf(stderr, "Ignoring coarse det, using %f\n", freqw16 * Fm / 65536);
589 #endif
591  }
592  }
complex< float > p
Definition: dvbs2.h:1134
static const int MAX_SYMBOLS_PER_FRAME
Definition: dvbs2.h:443
#define M_PI
Definition: rdsdemod.cpp:27
pipereader< complex< T > > in
Definition: dvbs2.h:1196
complex< float > diffcorr
Definition: dvbs2.h:500

◆ run_frame_locked()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::run_frame_locked ( )
inline

Definition at line 707 of file dvbs2.h.

References leansdr::modcod_info::c, leansdr::conjprod(), leansdr::cstln_amp, leansdr::modcod_info::esn0_nf, leansdr::FEC910, leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::fw16, leansdr::modcod_info::g1, leansdr::modcod_info::g2, leansdr::modcod_info::g3, leansdr::hamming_weight(), i, leansdr::complex< T >::im, leansdr::plslot< SOFTSYMB >::is_pls, leansdr::plslot< SOFTSYMB >::LENGTH, leansdr::cstln_lut< SOFTSYMB, R >::m_rateCode, leansdr::s2_pls::modcod, leansdr::modcod_infos, leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::mu, leansdr::cstln_base::names, leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::normalize(), leansdr::modcod_info::nslots_nf, leansdr::modcod_info::nsymbols, leansdr::opt_write(), leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::p, leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::ph16, leansdr::s2_pls::pilots, leansdr::plslot< SOFTSYMB >::pls, leansdr::modcod_info::rate, leansdr::complex< T >::re, leansdr::s2_pls::sf, leansdr::plslot< SOFTSYMB >::symbols, leansdr::sampler_interface< T >::update_freq(), and xfprintf.

708  {
709  complex<float> *psampled;
710  if (cstln_out && cstln_out->writable() >= 1024)
711  psampled = cstln_out->wr();
712  else
713  psampled = NULL;
714  complex<float> *psampled_pls;
715  if (cstln_pls_out && cstln_pls_out->writable() >= 1024)
716  psampled_pls = cstln_pls_out->wr();
717  else
718  psampled_pls = NULL;
719 
720 #if TEST_DIVERSITY
721  complex<float> *psymbols = symbols_out ? symbols_out->wr() : NULL;
722  float scale_symbols = 1.0 / cstln_amp;
723 #endif
724 
725  xfprintf(stderr, "lock0step fw= %f (%.0f Hz) mu=%f\n",
726  freqw16, freqw16 * Fm / 65536, mu);
727 
728  sampler_state ss = {in.rd(), mu, phase16, freqw16, scrambling.Rn};
729  sampler->update_freq(ss.fw16 / omega);
730 
731  update_agc();
732 
733  // Read PLSCODE
734 
735  uint64_t plscode = 0;
736  complex<float> pls_symbols[plscodes.LENGTH];
737  for (int s = 0; s < plscodes.LENGTH; ++s)
738  {
739  complex<float> p = interp_next(&ss) * agc_gain;
740 #if TEST_DIVERSITY
741  if (psymbols)
742  *psymbols++ = p * scale_symbols;
743 #endif
744  pls_symbols[s] = p;
745  if (psampled_pls)
746  *psampled_pls++ = p;
747  int bit = (p.im < 1); // TBD suboptimal
748  plscode = (plscode << 1) | bit;
749  }
750  int pls_index = -1;
751  int pls_errors = S2_MAX_ERR_PLSCODE + 1; // dmin=32
752  // TBD: Optimiser
753  for (int i = 0; i < plscodes.COUNT; ++i)
754  {
755  int e = hamming_weight(plscode ^ plscodes.codewords[i]);
756  if (e < pls_errors)
757  {
758  pls_errors = e;
759  pls_index = i;
760  }
761  }
762  if (pls_index < 0)
763  {
764  if (sch->debug2)
765  fprintf(stderr, "Too many errors in plheader (%d)\n", pls_errors);
766  in.read(ss.p - in.rd());
768  return;
769  }
770 
771  // Adjust phase with PLS
772  complex<float> pls_corr = conjprod(plscodes.symbols[pls_index],
773  pls_symbols, plscodes.LENGTH);
774  ss.normalize();
775  align_phase(&ss, pls_corr);
776 
777  s2_pls pls;
778  pls.modcod = pls_index >> 2; // Guaranteed 0..31
779  pls.sf = pls_index & 2;
780  pls.pilots = pls_index & 1;
781  xfprintf(stderr, "PLS: modcod %d, short=%d, pilots=%d (%d errors)\n",
782  pls.modcod, pls.sf, pls.pilots, pls_errors);
783  const modcod_info *mcinfo = &modcod_infos[pls.modcod];
784  if (!mcinfo->nslots_nf)
785  {
786  fprintf(stderr, "Unsupported or corrupted MODCOD\n");
787  in.read(ss.p - in.rd());
789  return;
790  }
791 #if 1 // TBD use fec_infos
792  if (pls.sf && mcinfo->rate == FEC910)
793  {
794  fprintf(stderr, "Unsupported or corrupted FEC\n");
795  in.read(ss.p - in.rd());
797  return;
798  }
799 #endif
800  // Store current MODCOD info
801  if (mcinfo->c != m_modcodType) {
802  m_modcodType = mcinfo->c;
803  }
804  if (mcinfo->rate != m_modcodRate) {
805  m_modcodRate = mcinfo->rate;
806  }
807 
808  // TBD Comparison of nsymbols is insufficient for DVB-S2X.
809  if (!cstln || cstln->nsymbols != mcinfo->nsymbols)
810  {
811  if (cstln)
812  {
813  fprintf(stderr, "Warning: Variable MODCOD is inefficient\n");
814  delete cstln;
815  }
816  fprintf(stderr, "Creating LUT for %s ratecode %d\n",
817  cstln_base::names[mcinfo->c], mcinfo->rate);
818  cstln = new cstln_lut<SOFTSYMB, 256>(mcinfo->c, mcinfo->esn0_nf,
819  mcinfo->g1, mcinfo->g2, mcinfo->g3);
820  cstln->m_rateCode = (int) mcinfo->rate;
821  cstln->m_typeCode = (int) mcinfo->c;
822  cstln->m_setByModcod = true;
823 #if 0
824  fprintf(stderr, "Dumping constellation LUT to stdout.\n");
825  cstln->dump(stdout);
826 #endif
827  }
828 
829  int S = pls.sf ? mcinfo->nslots_nf / 4 : mcinfo->nslots_nf;
830 
831  plslot<SOFTSYMB> *pout = out.wr(), *pout0 = pout;
832 
833  // Output special slot with PLS information
834  pout->is_pls = true;
835  pout->pls = pls;
836  ++pout;
837 
838  // Read slots and pilots
839 
840  int pilot_errors = 0;
841 
842  // Slots to skip until next PL slot (pilot or sof)
843  int till_next_pls = pls.pilots ? 16 : S;
844 
845  for (int leansdr_slots = S; leansdr_slots--; ++pout, --till_next_pls)
846  {
847  if (till_next_pls == 0)
848  {
849  // Read pilot
850  int errors = 0;
851  complex<float> corr = 0;
852  for (int s = 0; s < pilot_length; ++s)
853  {
854  complex<float> p0 = interp_next(&ss);
855  track_agc(p0);
856  complex<float> p = p0 * agc_gain;
857 #if TEST_DIVERSITY
858  if (psymbols)
859  *psymbols++ = p * scale_symbols;
860 #endif
861  (void)track_symbol(&ss, p, qpsk, 1);
862  if (psampled_pls)
863  *psampled_pls++ = p;
864  complex<float> d = descramble(&ss, p);
865  if (d.im < 0 || d.re < 0)
866  ++errors;
867  corr.re += d.re + d.im;
868  corr.im += d.im - d.re;
869  }
870  if (errors > S2_MAX_ERR_PILOT)
871  {
872  if (sch->debug2)
873  fprintf(stderr, "Too many errors in pilot (%d/36)\n", errors);
874  in.read(ss.p - in.rd());
876  return;
877  }
878  pilot_errors += errors;
879  ss.normalize();
880  align_phase(&ss, corr);
881  till_next_pls = 16;
882  }
883  // Read slot
884  pout->is_pls = false;
885  complex<float> p; // Export last symbols for cstln_out
886  for (int s = 0; s < pout->LENGTH; ++s)
887  {
888  p = interp_next(&ss) * agc_gain;
889 #if TEST_DIVERSITY
890  if (psymbols)
891  *psymbols++ = p * scale_symbols;
892 #endif
893 #if 1 || TEST_DIVERSITY
894  (void)track_symbol(&ss, p, cstln, 0); // SLOW
895 #endif
896  complex<float> d = descramble(&ss, p);
897 #if 0 // Slow
898  SOFTSYMB *symb = &cstln->lookup(d.re, d.im)->ss;
899 #else // Avoid scaling floats. May wrap at very low SNR.
900  SOFTSYMB *symb = &cstln->lookup((int)d.re, (int)d.im)->ss;
901 #endif
902  pout->symbols[s] = *symb;
903  }
904  if (psampled)
905  *psampled++ = p;
906  } // slots
907 
908  // Read SOF
909 
910  memset(hist, 0, sizeof(hist));
911  complex<float> sof_corr = 0;
912  uint32_t sofbits = 0;
913  for (int s = 0; s < sof.LENGTH; ++s)
914  {
915  complex<float> p0 = interp_next(&ss);
916  track_agc(p0);
917  complex<float> p = p0 * agc_gain;
918 #if TEST_DIVERSITY
919  if (psymbols)
920  *psymbols++ = p * scale_symbols;
921 #endif
922  uint8_t symb = track_symbol(&ss, p, qpsk, 1);
923  if (psampled_pls)
924  *psampled_pls++ = p;
925  int bit = (p.im < 0); // suboptimal
926  sofbits = (sofbits << 1) | bit;
927  sof_corr += conjprod(sof.symbols[s], p);
928  }
929  int sof_errors = hamming_weight(sofbits ^ sof.VALUE);
930  if (sof_errors >= S2_MAX_ERR_SOF)
931  {
932  if (sch->debug2)
933  fprintf(stderr, "Too many errors in SOF (%d/26)\n", sof_errors);
934  in.read(ss.p - in.rd());
936  return;
937  }
938  ss.normalize();
939  align_phase(&ss, sof_corr);
940 
941  // Commit whole frame after final SOF.
942  out.written(pout - pout0);
943 
944  // Write back sampler progress
945  meas_count += ss.p - in.rd();
946  in.read(ss.p - in.rd());
947  mu = ss.mu;
948  phase16 = ss.ph16;
949  freqw16 = ss.fw16;
950 
951  // Measurements
952  if (psampled)
953  cstln_out->written(psampled - cstln_out->wr());
954  if (psampled_pls)
955  cstln_pls_out->written(psampled_pls - cstln_pls_out->wr());
956 #if TEST_DIVERSITY
957  if (psymbols)
958  symbols_out->written(psymbols - symbols_out->wr());
959 #endif
961  {
962  opt_write(freq_out, freqw16 / 65536 / omega);
964  // TBD Adjust if cfg.strongpls
965  float mer = ev_power ? (float)cstln_amp * cstln_amp / ev_power : 1;
966  opt_write(mer_out, 10 * logf(mer) / logf(10));
968  }
969 
970  int all_errors = pls_errors + pilot_errors + sof_errors;
971  int max_errors = plscodes.LENGTH + sof.LENGTH;
972  if (pls.pilots)
973  max_errors += ((S - 1) / 16) * pilot_length;
974 
975  xfprintf(stderr, "success fw= %f (%.0f Hz) mu= %f "
976  "errors=%d/64+%d+%d/26 = %2d/%d\n",
977  freqw16, freqw16 * Fm / 65536, mu,
978  pls_errors, pilot_errors, sof_errors, all_errors, max_errors);
979  pl_errors += all_errors;
980  pl_symbols += max_errors;
981  }
complex< float > p
Definition: dvbs2.h:1134
static const char * names[]
Definition: sdr.h:476
pipewriter< float > * freq_out
Definition: dvbs2.h:1199
s2_plscodes< T > plscodes
Definition: dvbs2.h:1152
int m_typeCode
Definition: sdr.h:879
pipewriter< complex< float > > * symbols_out
Definition: dvbs2.h:1202
uint8_t Rn[131072]
Definition: dvbs2.h:129
complex< float > interp_next(sampler_state *ss)
Definition: dvbs2.h:1044
int hamming_weight(uint8_t x)
Definition: math.cpp:6
bool m_setByModcod
Definition: sdr.h:881
s2_scrambling scrambling
Definition: dvbs2.h:1206
unsigned int uint32_t
Definition: rtptypes_win.h:46
uint8_t track_symbol(sampler_state *ss, const complex< float > &p, cstln_lut< SOFTSYMB, 256 > *c, int mode)
Definition: dvbs2.h:1087
cstln_lut< SOFTSYMB, 256 > * qpsk
Definition: dvbs2.h:1142
unsigned char uint8_t
Definition: rtptypes_win.h:42
complex< float > descramble(sampler_state *ss, const complex< float > &p)
Definition: dvbs2.h:1018
void opt_write(pipewriter< T > *p, T val)
Definition: framework.h:341
cstln_lut< SOFTSYMB, 256 > * cstln
Definition: dvbs2.h:1153
result * lookup(float I, float Q)
Definition: sdr.h:689
int32_t i
Definition: decimators.h:244
pipewriter< complex< float > > * cstln_pls_out
Definition: dvbs2.h:1201
pipewriter< plslot< SOFTSYMB > > out
Definition: dvbs2.h:1197
void track_agc(const complex< float > &p)
Definition: dvbs2.h:995
void align_phase(sampler_state *ss, const complex< float > &c)
Definition: dvbs2.h:1073
int m_rateCode
Definition: sdr.h:880
const struct leansdr::modcod_info modcod_infos[32]
pipereader< complex< T > > in
Definition: dvbs2.h:1196
scheduler * sch
Definition: framework.h:199
struct leansdr::s2_frame_receiver::@6 hist[3]
const float cstln_amp
Definition: sdr.h:404
modcod_info * mcinfo
Definition: dvbs2.h:1195
void dump(FILE *f)
Definition: sdr.h:839
pipewriter< float > * ss_out
Definition: dvbs2.h:1199
sampler_interface< T > * sampler
Definition: dvbs2.h:438
pipewriter< complex< float > > * cstln_out
Definition: dvbs2.h:1200
pipewriter< float > * mer_out
Definition: dvbs2.h:1199
#define xfprintf(...)
Definition: dvbs2.h:702
complex< T > conjprod(const complex< T > &u, const complex< T > &v)
Definition: math.h:105
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48
+ Here is the call graph for this function:

◆ run_frame_search()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::run_frame_search ( )
inline

Definition at line 605 of file dvbs2.h.

References floor(), leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::fw16, leansdr::hamming_weight(), leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::mu, leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::normalize(), leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::p, leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::ph16, and leansdr::sampler_interface< T >::update_freq().

606  {
607  complex<float> *psampled;
608  if (cstln_out && cstln_out->writable() >= 1024)
609  psampled = cstln_out->wr();
610  else
611  psampled = NULL;
612 
613  // Preserve float precision
614  phase16 -= 65536 * floor(phase16 / 65536);
615 
616  int nsymbols = MAX_SYMBOLS_PER_FRAME; // TBD Adjust after PLS decoding
617 
618  sampler_state ss = {in.rd(), mu, phase16, freqw16};
619  sampler->update_freq(ss.fw16 / omega);
620 
621  if (!in_power)
622  init_agc(ss.p, 64);
623  update_agc();
624 
625  for (int s = 0; s < nsymbols; ++s)
626  {
627  complex<float> p0 = interp_next(&ss);
628  track_agc(p0);
629  complex<float> p = p0 * agc_gain;
630 
631  // Constellation plot
632  if (psampled && s < 1024)
633  *psampled++ = p;
634 
635  // Demodulate everything as QPSK.
636  // Occasionally it locks onto 8PSK at offet 2pi/16.
637  uint8_t symb = track_symbol(&ss, p, qpsk, 1);
638 
639  // Feed symbol into all synchronizers.
640  for (sync *ps = syncs; ps < syncs + nsyncs; ++ps)
641  {
642  ps->hist = (ps->hist << 1) | ((ps->tobpsk >> symb) & 1);
643  int errors = hamming_weight((ps->hist & sof.MASK) ^ sof.VALUE);
644  if (errors <= S2_MAX_ERR_SOF_INITIAL)
645  {
646  if (sch->debug2)
647  fprintf(stderr, "Found SOF+%d at %d offset %f\n",
648  errors, s, ps->offset16);
649  ss.ph16 += ps->offset16;
650  in.read(ss.p - in.rd());
651  mu = ss.mu;
652  phase16 = ss.ph16;
653  freqw16 = ss.fw16;
654  if (psampled)
655  cstln_out->written(psampled - cstln_out->wr());
657  return;
658  }
659  }
660  ss.normalize();
661  }
662 
663  // Write back sampler progress
664  in.read(ss.p - in.rd());
665  mu = ss.mu;
666  phase16 = ss.ph16;
667  freqw16 = ss.fw16;
668  if (psampled)
669  cstln_out->written(psampled - cstln_out->wr());
670  }
complex< float > p
Definition: dvbs2.h:1134
complex< float > interp_next(sampler_state *ss)
Definition: dvbs2.h:1044
int hamming_weight(uint8_t x)
Definition: math.cpp:6
static const int MAX_SYMBOLS_PER_FRAME
Definition: dvbs2.h:443
Fixed< IntType, IntBits > floor(Fixed< IntType, IntBits > const &x)
Definition: fixed.h:2301
uint8_t track_symbol(sampler_state *ss, const complex< float > &p, cstln_lut< SOFTSYMB, 256 > *c, int mode)
Definition: dvbs2.h:1087
cstln_lut< SOFTSYMB, 256 > * qpsk
Definition: dvbs2.h:1142
unsigned char uint8_t
Definition: rtptypes_win.h:42
void track_agc(const complex< float > &p)
Definition: dvbs2.h:995
struct leansdr::s2_frame_receiver::sync syncs[MAXSYNCS]
pipereader< complex< T > > in
Definition: dvbs2.h:1196
scheduler * sch
Definition: framework.h:199
void init_agc(const complex< T > *buf, int n)
Definition: dvbs2.h:988
sampler_interface< T > * sampler
Definition: dvbs2.h:438
pipewriter< complex< float > > * cstln_out
Definition: dvbs2.h:1200
+ Here is the call graph for this function:

◆ shutdown()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::shutdown ( )
inlinevirtual

Reimplemented from leansdr::runnable_common.

Definition at line 983 of file dvbs2.h.

984  {
985  fprintf(stderr, "PL SER: %f ppm\n", pl_errors / (pl_symbols + 1e-6) * 1e6);
986  }

◆ track_agc()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::track_agc ( const complex< float > &  p)
inline

Definition at line 995 of file dvbs2.h.

References leansdr::complex< T >::im, and leansdr::complex< T >::re.

996  {
997  float in_p = p.re * p.re + p.im * p.im;
998  in_power = in_p * agc_bw + in_power * (1.0f - agc_bw);
999  }

◆ track_symbol()

template<typename T, typename SOFTSYMB>
uint8_t leansdr::s2_frame_receiver< T, SOFTSYMB >::track_symbol ( sampler_state ss,
const complex< float > &  p,
cstln_lut< SOFTSYMB, 256 > *  c,
int  mode 
)
inline

Definition at line 1087 of file dvbs2.h.

References leansdr::cstln_amp, leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::fw16, leansdr::complex< T >::im, leansdr::cstln_lut< SOFTSYMB, R >::lookup(), leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::mu, leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler_state::ph16, leansdr::complex< T >::re, and leansdr::cstln_base::symbols.

1089  {
1090  static struct
1091  {
1092  float kph, kfw, kmu;
1093  } gains[2] = {
1094  {4e-2, 1e-4, 0.001 / (cstln_amp * cstln_amp)},
1095  {4e-2, 1e-4, 0.001 / (cstln_amp * cstln_amp)}};
1096  // Decision
1097  typename cstln_lut<SOFTSYMB, 256>::result *cr = c->lookup(p.re, p.im);
1098  // Carrier tracking
1099  ss->ph16 += cr->phase_error * gains[mode].kph;
1100  ss->fw16 += cr->phase_error * gains[mode].kfw;
1101  if (ss->fw16 < min_freqw16)
1102  ss->fw16 = min_freqw16;
1103  if (ss->fw16 > max_freqw16)
1104  ss->fw16 = max_freqw16;
1105  // Phase tracking
1106  hist[2] = hist[1];
1107  hist[1] = hist[0];
1108  hist[0].p = p;
1109  complex<int8_t> *cp = &c->symbols[cr->symbol];
1110  hist[0].c.re = cp->re;
1111  hist[0].c.im = cp->im;
1112  float muerr =
1113  ((hist[0].p.re - hist[2].p.re) * hist[1].c.re +
1114  (hist[0].p.im - hist[2].p.im) * hist[1].c.im) -
1115  ((hist[0].c.re - hist[2].c.re) * hist[1].p.re +
1116  (hist[0].c.im - hist[2].c.im) * hist[1].p.im);
1117  float mucorr = muerr * gains[mode].kmu;
1118  const float max_mucorr = 0.1;
1119  // TBD Optimize out statically
1120  if (mucorr < -max_mucorr)
1121  mucorr = -max_mucorr;
1122  if (mucorr > max_mucorr)
1123  mucorr = max_mucorr;
1124  ss->mu += mucorr;
1125  // Error vector for MER
1126  complex<float> ev(p.re - cp->re, p.im - cp->im);
1127  float ev_p = ev.re * ev.re + ev.im * ev.im;
1128  ev_power = ev_p * agc_bw + ev_power * (1.0f - agc_bw);
1129  return cr->symbol;
1130  }
complex< float > p
Definition: dvbs2.h:1134
result * lookup(float I, float Q)
Definition: sdr.h:689
complex< int8_t > * symbols
Definition: sdr.h:478
struct leansdr::s2_frame_receiver::@6 hist[3]
const float cstln_amp
Definition: sdr.h:404
+ Here is the call graph for this function:

◆ update_agc()

template<typename T, typename SOFTSYMB>
void leansdr::s2_frame_receiver< T, SOFTSYMB >::update_agc ( )
inline

Definition at line 1001 of file dvbs2.h.

References leansdr::cstln_amp, and leansdr::gen_sqrt().

1002  {
1003  float in_amp = gen_sqrt(in_power);
1004  if (!in_amp)
1005  return;
1006  if (!strongpls || !cstln)
1007  {
1008  // Match RMS amplitude
1009  agc_gain = cstln_amp / in_amp;
1010  }
1011  else
1012  {
1013  // Match peak amplitude
1014  agc_gain = cstln_amp / cstln->amp_max / in_amp;
1015  }
1016  }
float amp_max
Definition: sdr.h:477
cstln_lut< SOFTSYMB, 256 > * cstln
Definition: dvbs2.h:1153
T gen_sqrt(T x)
const float cstln_amp
Definition: sdr.h:404
+ Here is the call graph for this function:

Member Data Documentation

◆ agc_bw

template<typename T, typename SOFTSYMB>
float leansdr::s2_frame_receiver< T, SOFTSYMB >::agc_bw

Definition at line 1141 of file dvbs2.h.

◆ agc_gain

template<typename T, typename SOFTSYMB>
float leansdr::s2_frame_receiver< T, SOFTSYMB >::agc_gain

Definition at line 1140 of file dvbs2.h.

◆ c

template<typename T, typename SOFTSYMB>
complex<float> leansdr::s2_frame_receiver< T, SOFTSYMB >::c

Definition at line 1135 of file dvbs2.h.

◆ coarse_count

template<typename T, typename SOFTSYMB>
int leansdr::s2_frame_receiver< T, SOFTSYMB >::coarse_count

Definition at line 501 of file dvbs2.h.

◆ cstln

template<typename T, typename SOFTSYMB>
cstln_lut<SOFTSYMB, 256>* leansdr::s2_frame_receiver< T, SOFTSYMB >::cstln

Definition at line 1153 of file dvbs2.h.

Referenced by DATVDemod::feed(), and DATVDemod::InitDATVS2Framework().

◆ cstln_out

template<typename T, typename SOFTSYMB>
pipewriter<complex<float> >* leansdr::s2_frame_receiver< T, SOFTSYMB >::cstln_out

Definition at line 1200 of file dvbs2.h.

◆ cstln_pls_out

template<typename T, typename SOFTSYMB>
pipewriter<complex<float> >* leansdr::s2_frame_receiver< T, SOFTSYMB >::cstln_pls_out

Definition at line 1201 of file dvbs2.h.

◆ current_sync

template<typename T, typename SOFTSYMB>
struct leansdr::s2_frame_receiver::sync * leansdr::s2_frame_receiver< T, SOFTSYMB >::current_sync[MAXSYNCS]

◆ diffcorr

template<typename T, typename SOFTSYMB>
complex<float> leansdr::s2_frame_receiver< T, SOFTSYMB >::diffcorr

Definition at line 500 of file dvbs2.h.

◆ ev_power

template<typename T, typename SOFTSYMB>
float leansdr::s2_frame_receiver< T, SOFTSYMB >::ev_power

Definition at line 1139 of file dvbs2.h.

◆ Fm

template<typename T, typename SOFTSYMB>
float leansdr::s2_frame_receiver< T, SOFTSYMB >::Fm

Definition at line 441 of file dvbs2.h.

Referenced by DATVDemod::InitDATVS2Framework().

◆ freq_out

template<typename T, typename SOFTSYMB>
pipewriter<float>* leansdr::s2_frame_receiver< T, SOFTSYMB >::freq_out

Definition at line 1199 of file dvbs2.h.

◆ freqw16

template<typename T, typename SOFTSYMB>
float leansdr::s2_frame_receiver< T, SOFTSYMB >::freqw16

Definition at line 504 of file dvbs2.h.

◆ Ftune

template<typename T, typename SOFTSYMB>
float leansdr::s2_frame_receiver< T, SOFTSYMB >::Ftune

Definition at line 440 of file dvbs2.h.

Referenced by DATVDemod::InitDATVS2Framework().

◆ hist

struct { ... } leansdr::s2_frame_receiver< T, SOFTSYMB >::hist[3]

◆ in

template<typename T, typename SOFTSYMB>
pipereader<complex<T> > leansdr::s2_frame_receiver< T, SOFTSYMB >::in

Definition at line 1196 of file dvbs2.h.

◆ in_power

template<typename T, typename SOFTSYMB>
float leansdr::s2_frame_receiver< T, SOFTSYMB >::in_power

Definition at line 1139 of file dvbs2.h.

◆ m_modcodRate

template<typename T, typename SOFTSYMB>
int leansdr::s2_frame_receiver< T, SOFTSYMB >::m_modcodRate

Definition at line 1209 of file dvbs2.h.

Referenced by DATVDemod::feed().

◆ m_modcodType

template<typename T, typename SOFTSYMB>
int leansdr::s2_frame_receiver< T, SOFTSYMB >::m_modcodType

Definition at line 1208 of file dvbs2.h.

Referenced by DATVDemod::feed().

◆ max_freqw16

template<typename T, typename SOFTSYMB>
float leansdr::s2_frame_receiver< T, SOFTSYMB >::max_freqw16

Definition at line 497 of file dvbs2.h.

◆ MAX_SLOTS

template<typename T, typename SOFTSYMB>
const int leansdr::s2_frame_receiver< T, SOFTSYMB >::MAX_SLOTS = 240
static

Definition at line 1212 of file dvbs2.h.

◆ MAX_SYMBOLS

template<typename T, typename SOFTSYMB>
const int leansdr::s2_frame_receiver< T, SOFTSYMB >::MAX_SYMBOLS
static
Initial value:
=
(1 + MAX_SLOTS) * plslot<SOFTSYMB>::LENGTH + ((MAX_SLOTS - 1) / 16) * pilot_length

Definition at line 1213 of file dvbs2.h.

◆ MAX_SYMBOLS_PER_FRAME

template<typename T, typename SOFTSYMB>
const int leansdr::s2_frame_receiver< T, SOFTSYMB >::MAX_SYMBOLS_PER_FRAME
static
Initial value:

Definition at line 443 of file dvbs2.h.

◆ MAXSYNCS

template<typename T, typename SOFTSYMB>
const int leansdr::s2_frame_receiver< T, SOFTSYMB >::MAXSYNCS = 8
static

Definition at line 1143 of file dvbs2.h.

◆ mcinfo

template<typename T, typename SOFTSYMB>
modcod_info* leansdr::s2_frame_receiver< T, SOFTSYMB >::mcinfo

Definition at line 1195 of file dvbs2.h.

◆ meas_count

template<typename T, typename SOFTSYMB>
int leansdr::s2_frame_receiver< T, SOFTSYMB >::meas_count

Definition at line 1198 of file dvbs2.h.

◆ meas_decimation

template<typename T, typename SOFTSYMB>
int leansdr::s2_frame_receiver< T, SOFTSYMB >::meas_decimation

Definition at line 439 of file dvbs2.h.

Referenced by DATVDemod::InitDATVS2Framework().

◆ mer_out

template<typename T, typename SOFTSYMB>
pipewriter<float> * leansdr::s2_frame_receiver< T, SOFTSYMB >::mer_out

Definition at line 1199 of file dvbs2.h.

◆ min_freqw16

template<typename T, typename SOFTSYMB>
float leansdr::s2_frame_receiver< T, SOFTSYMB >::min_freqw16

Definition at line 497 of file dvbs2.h.

◆ mu

template<typename T, typename SOFTSYMB>
float leansdr::s2_frame_receiver< T, SOFTSYMB >::mu

Definition at line 507 of file dvbs2.h.

◆ nsyncs

template<typename T, typename SOFTSYMB>
int leansdr::s2_frame_receiver< T, SOFTSYMB >::nsyncs

Definition at line 1151 of file dvbs2.h.

◆ omega

template<typename T, typename SOFTSYMB>
float leansdr::s2_frame_receiver< T, SOFTSYMB >::omega

Definition at line 508 of file dvbs2.h.

Referenced by DATVDemod::InitDATVS2Framework().

◆ out

template<typename T, typename SOFTSYMB>
pipewriter<plslot<SOFTSYMB> > leansdr::s2_frame_receiver< T, SOFTSYMB >::out

Definition at line 1197 of file dvbs2.h.

◆ p

template<typename T, typename SOFTSYMB>
complex<float> leansdr::s2_frame_receiver< T, SOFTSYMB >::p

Definition at line 1134 of file dvbs2.h.

◆ phase16

template<typename T, typename SOFTSYMB>
float leansdr::s2_frame_receiver< T, SOFTSYMB >::phase16

Definition at line 505 of file dvbs2.h.

◆ plscodes

template<typename T, typename SOFTSYMB>
s2_plscodes<T> leansdr::s2_frame_receiver< T, SOFTSYMB >::plscodes

Definition at line 1152 of file dvbs2.h.

◆ qpsk

template<typename T, typename SOFTSYMB>
cstln_lut<SOFTSYMB, 256>* leansdr::s2_frame_receiver< T, SOFTSYMB >::qpsk

Definition at line 1142 of file dvbs2.h.

◆ report_state

template<typename T, typename SOFTSYMB>
bool leansdr::s2_frame_receiver< T, SOFTSYMB >::report_state

Definition at line 1204 of file dvbs2.h.

◆ sampler

template<typename T, typename SOFTSYMB>
sampler_interface<T>* leansdr::s2_frame_receiver< T, SOFTSYMB >::sampler

Definition at line 438 of file dvbs2.h.

◆ scrambling

template<typename T, typename SOFTSYMB>
s2_scrambling leansdr::s2_frame_receiver< T, SOFTSYMB >::scrambling

Definition at line 1206 of file dvbs2.h.

◆ sof

template<typename T, typename SOFTSYMB>
s2_sof<T> leansdr::s2_frame_receiver< T, SOFTSYMB >::sof

Definition at line 1207 of file dvbs2.h.

◆ ss_out

template<typename T, typename SOFTSYMB>
pipewriter<float> * leansdr::s2_frame_receiver< T, SOFTSYMB >::ss_out

Definition at line 1199 of file dvbs2.h.

◆ state

enum { ... } leansdr::s2_frame_receiver< T, SOFTSYMB >::state

◆ state_out

template<typename T, typename SOFTSYMB>
pipewriter<int>* leansdr::s2_frame_receiver< T, SOFTSYMB >::state_out

Definition at line 1203 of file dvbs2.h.

◆ strongpls

template<typename T, typename SOFTSYMB>
bool leansdr::s2_frame_receiver< T, SOFTSYMB >::strongpls

Definition at line 442 of file dvbs2.h.

Referenced by DATVDemod::InitDATVS2Framework().

◆ symbols_out

template<typename T, typename SOFTSYMB>
pipewriter<complex<float> >* leansdr::s2_frame_receiver< T, SOFTSYMB >::symbols_out

Definition at line 1202 of file dvbs2.h.

◆ syncs

template<typename T, typename SOFTSYMB>
struct leansdr::s2_frame_receiver::sync leansdr::s2_frame_receiver< T, SOFTSYMB >::syncs[MAXSYNCS]

◆ trig

template<typename T, typename SOFTSYMB>
trig16 leansdr::s2_frame_receiver< T, SOFTSYMB >::trig

Definition at line 1194 of file dvbs2.h.


The documentation for this struct was generated from the following file: