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 Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
DATVDemod Class Reference

#include <datvdemod.h>

+ Inheritance diagram for DATVDemod:
+ Collaboration diagram for DATVDemod:

Classes

class  MsgConfigureChannelizer
 
class  MsgConfigureDATVDemod
 
class  MsgReportModcodCstlnChange
 

Public Member Functions

 DATVDemod (DeviceAPI *)
 
 ~DATVDemod ()
 
virtual void destroy ()
 
virtual void getIdentifier (QString &id)
 
virtual void getTitle (QString &title)
 
virtual qint64 getCenterFrequency () const
 Applies to a default stream. More...
 
virtual QByteArray serialize () const
 
virtual bool deserialize (const QByteArray &data)
 
virtual void feed (const SampleVector::const_iterator &begin, const SampleVector::const_iterator &end, bool po)
 
virtual void start ()
 
virtual void stop ()
 
virtual bool handleMessage (const Message &cmd)
 Processing of a message. Returns true if message has actually been processed. More...
 
virtual int getNbSinkStreams () const
 
virtual int getNbSourceStreams () const
 
virtual qint64 getStreamCenterFrequency (int streamIndex, bool sinkElseSource) const
 
bool SetTVScreen (TVScreen *objScreen)
 
DATVideostreamSetVideoRender (DATVideoRender *objScreen)
 
bool audioActive ()
 
bool audioDecodeOK ()
 
bool videoActive ()
 
bool videoDecodeOK ()
 
bool PlayVideo (bool blnStartStop)
 
void InitDATVParameters (int intMsps, int intRFBandwidth, int intCenterFrequency, DATVDemodSettings::dvb_version enmStandard, DATVDemodSettings::DATVModulation enmModulation, leansdr::code_rate enmFEC, int intSampleRate, int intSymbolRate, int intNotchFilters, bool blnAllowDrift, bool blnFastLock, DATVDemodSettings::dvb_sampler enmFilter, bool blnHardMetric, float fltRollOff, bool blnViterbi, int intEExcursion)
 
void CleanUpDATVFramework (bool blnRelease)
 
int GetSampleRate ()
 
void InitDATVFramework ()
 
void InitDATVS2Framework ()
 
double getMagSq () const
 Beware this is scaled to 2^30. More...
 
int getModcodModulation () const
 
int getModcodCodeRate () const
 
bool isCstlnSetByModcod () const
 
- Public Member Functions inherited from BasebandSampleSink
 BasebandSampleSink ()
 
virtual ~BasebandSampleSink ()
 
MessageQueuegetInputMessageQueue ()
 Get the queue for asynchronous inbound communication. More...
 
virtual void setMessageQueueToGUI (MessageQueue *queue)
 
MessageQueuegetMessageQueueToGUI ()
 
- Public Member Functions inherited from ChannelAPI
 ChannelAPI (const QString &name, StreamType streamType)
 
virtual ~ChannelAPI ()
 
virtual void setName (const QString &name)
 
virtual const QString & getName () const
 
virtual int webapiSettingsGet (SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
 
virtual int webapiSettingsPutPatch (bool force, const QStringList &channelSettingsKeys, SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
 
virtual int webapiReportGet (SWGSDRangel::SWGChannelReport &response, QString &errorMessage)
 
int getIndexInDeviceSet () const
 
void setIndexInDeviceSet (int indexInDeviceSet)
 
int getDeviceSetIndex () const
 
void setDeviceSetIndex (int deviceSetIndex)
 
DeviceAPIgetDeviceAPI ()
 
void setDeviceAPI (DeviceAPI *deviceAPI)
 
uint64_t getUID () const
 
StreamType getStreamType () const
 

Static Public Member Functions

static DATVDemodSettings::DATVCodeRate getCodeRateFromLeanDVBCode (int leanDVBCodeRate)
 
static DATVDemodSettings::DATVModulation getModulationFromLeanDVBCode (int leanDVBModulation)
 
static int getLeanDVBCodeRateFromDATV (DATVDemodSettings::DATVCodeRate datvCodeRate)
 
static int getLeanDVBModulationFromDATV (DATVDemodSettings::DATVModulation datvModulation)
 

Static Public Attributes

static const QString m_channelIdURI = "sdrangel.channel.demoddatv"
 
static const QString m_channelId = "DATVDemod"
 

Private Member Functions

void applySettings (const DATVDemodSettings &settings, bool force=false)
 
void applyChannelSettings (int inputSampleRate, int inputFrequencyOffset, bool force=false)
 

Private Attributes

unsigned long m_lngExpectedReadIQ
 
long m_lngReadIQ
 
unsigned long BUF_BASEBAND
 
unsigned long BUF_SYMBOLS
 
unsigned long BUF_BYTES
 
unsigned long BUF_MPEGBYTES
 
unsigned long BUF_PACKETS
 
unsigned long BUF_SLOW
 
unsigned long BUF_SLOTS
 
unsigned long BUF_FRAMES
 
unsigned long BUF_S2PACKETS
 
unsigned long S2_MAX_SYMBOLS
 
leansdr::schedulerm_objScheduler
 
struct config m_objCfg
 
bool m_blnDVBInitialized
 
bool m_blnNeedConfigUpdate
 
leansdr::pipebuf< leansdr::cf32 > * p_rawiq
 
leansdr::pipewriter< leansdr::cf32 > * p_rawiq_writer
 
leansdr::pipebuf< leansdr::cf32 > * p_preprocessed
 
leansdr::auto_notch< leansdr::f32 > * r_auto_notch
 
leansdr::pipebuf< leansdr::cf32 > * p_autonotched
 
leansdr::pipebuf< leansdr::cf32 > * p_derot
 
leansdr::rotator< leansdr::f32 > * r_derot
 
leansdr::pipebuf< leansdr::f32 > * p_cnr
 
leansdr::cnr_fft< leansdr::f32 > * r_cnr
 
leansdr::fir_filter< leansdr::cf32, float > * r_resample
 
leansdr::pipebuf< leansdr::cf32 > * p_resampled
 
float * coeffs
 
int ncoeffs
 
leansdr::sampler_interface< leansdr::f32 > * sampler
 
float * coeffs_sampler
 
int ncoeffs_sampler
 
leansdr::pipebuf< leansdr::eucl_ss > * p_symbols
 
leansdr::pipebuf< leansdr::f32 > * p_freq
 
leansdr::pipebuf< leansdr::f32 > * p_ss
 
leansdr::pipebuf< leansdr::f32 > * p_mer
 
leansdr::pipebuf< leansdr::cf32 > * p_sampled
 
void * p_slots_dvbs2
 
leansdr::pipebuf< leansdr::cf32 > * p_cstln
 
leansdr::pipebuf< leansdr::cf32 > * p_cstln_pls
 
leansdr::pipebuf< int > * p_framelock
 
void * m_objDemodulatorDVBS2
 
void * p_fecframes
 
void * p_bbframes
 
void * p_s2_deinterleaver
 
void * r_fecdec
 
void * p_deframer
 
leansdr::pipebuf< leansdr::cf32 > * p_decimated
 
leansdr::decimator< leansdr::cf32 > * p_decim
 
leansdr::file_writer< leansdr::cf32 > * r_ppout
 
leansdr::cstln_receiver< leansdr::f32, leansdr::eucl_ss > * m_objDemodulator
 
leansdr::pipebuf< leansdr::u8 > * p_bytes
 
leansdr::deconvol_sync_simpler_deconv
 
leansdr::viterbi_syncr
 
leansdr::pipebuf< leansdr::u8 > * p_descrambled
 
leansdr::pipebuf< leansdr::u8 > * p_frames
 
leansdr::etr192_descramblerr_etr192_descrambler
 
leansdr::hdlc_syncr_sync
 
leansdr::pipebuf< leansdr::u8 > * p_mpegbytes
 
leansdr::pipebuf< int > * p_lock
 
leansdr::pipebuf< leansdr::u32 > * p_locktime
 
leansdr::mpeg_sync< leansdr::u8, 0 > * r_sync_mpeg
 
leansdr::pipebuf< leansdr::rspacket< leansdr::u8 > > * p_rspackets
 
leansdr::deinterleaver< leansdr::u8 > * r_deinter
 
leansdr::pipebuf< int > * p_vbitcount
 
leansdr::pipebuf< int > * p_verrcount
 
leansdr::pipebuf< leansdr::tspacket > * p_rtspackets
 
leansdr::rs_decoder< leansdr::u8, 0 > * r_rsdec
 
leansdr::pipebuf< float > * p_vber
 
leansdr::rate_estimator< float > * r_vber
 
leansdr::pipebuf< leansdr::tspacket > * p_tspackets
 
leansdr::derandomizerr_derand
 
leansdr::file_writer< leansdr::tspacket > * r_stdout
 
leansdr::datvvideoplayer< leansdr::tspacket > * r_videoplayer
 
leansdr::datvconstellation< leansdr::f32 > * r_scope_symbols
 
leansdr::datvdvbs2constellation< leansdr::f32 > * r_scope_symbols_dvbs2
 
DeviceAPIm_deviceAPI
 
ThreadedBasebandSampleSinkm_threadedChannelizer
 
DownChannelizerm_channelizer
 
TVScreenm_objRegisteredTVScreen
 
DATVideoRenderm_objRegisteredVideoRender
 
DATVideostreamm_objVideoStream
 
DATVUDPStream m_udpStream
 
DATVideoRenderThreadm_objRenderThread
 
AudioFifo m_audioFifo
 
fftfiltm_objRFFilter
 
NCO m_objNCO
 
bool m_blnInitialized
 
bool m_blnRenderingVideo
 
bool m_blnStartStopVideo
 
bool m_cstlnSetByModcod
 
int m_modcodModulation
 
int m_modcodCodeRate
 
DATVDemodSettings::DATVModulation m_enmModulation
 
DATVDemodSettings m_settings
 
int m_sampleRate
 
int m_inputFrequencyOffset
 
MovingAverageUtil< double, double, 32 > m_objMagSqAverage
 
QMutex m_objSettingsMutex
 

Additional Inherited Members

- Public Types inherited from ChannelAPI
enum  StreamType { StreamSingleSink, StreamSingleSource, StreamMIMO }
 < This is the same enum as in PluginInterface More...
 
- Protected Slots inherited from BasebandSampleSink
void handleInputMessages ()
 
- Protected Attributes inherited from BasebandSampleSink
MessageQueue m_inputMessageQueue
 Queue for asynchronous inbound communication. More...
 
MessageQueuem_guiMessageQueue
 Input message queue to the GUI. More...
 

Detailed Description

Definition at line 125 of file datvdemod.h.

Constructor & Destructor Documentation

◆ DATVDemod()

DATVDemod::DATVDemod ( DeviceAPI deviceAPI)

Definition at line 42 of file datvdemod.cpp.

References AudioDeviceManager::addAudioSink(), DSPEngine::getAudioDeviceManager(), DSPEngine::instance(), and rfFilterFftLength.

42  :
44  m_blnNeedConfigUpdate(false),
45  m_deviceAPI(deviceAPI),
48  m_objVideoStream(nullptr),
50  m_objRenderThread(nullptr),
51  m_audioFifo(48000),
52  m_blnRenderingVideo(false),
53  m_blnStartStopVideo(false),
54  m_cstlnSetByModcod(false),
56  m_modcodCodeRate(-1),
58  m_sampleRate(1024000),
59  m_objSettingsMutex(QMutex::NonRecursive)
60 {
61  setObjectName("DATVDemod");
62 
64  //m_audioSampleRate = DSPEngine::instance()->getAudioDeviceManager()->getOutputSampleRate();
65 
66  //*************** DATV PARAMETERS ***************
67  m_blnInitialized=false;
68  CleanUpDATVFramework(false);
69 
71 
72  m_objRFFilter = new fftfilt(-256000.0 / 1024000.0, 256000.0 / 1024000.0, rfFilterFftLength);
73 
74  m_channelizer = new DownChannelizer(this);
78 }
void addAudioSink(AudioFifo *audioFifo, MessageQueue *sampleSinkMessageQueue, int outputDeviceIndex=-1)
Add the audio sink.
bool m_cstlnSetByModcod
Definition: datvdemod.h:420
void addChannelSinkAPI(ChannelAPI *channelAPI, int streamIndex=0)
Definition: deviceapi.cpp:156
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
bool m_blnNeedConfigUpdate
Definition: datvdemod.h:296
static const QString m_channelIdURI
Definition: datvdemod.h:197
bool m_blnRenderingVideo
Definition: datvdemod.h:418
DATVideoRender * m_objRegisteredVideoRender
Definition: datvdemod.h:406
bool m_blnInitialized
Definition: datvdemod.h:417
DeviceAPI * m_deviceAPI
Definition: datvdemod.h:399
static DSPEngine * instance()
Definition: dspengine.cpp:51
static const int SIZE
Definition: dvb.h:1173
int m_modcodCodeRate
Definition: datvdemod.h:422
DATVUDPStream m_udpStream
Definition: datvdemod.h:408
QMutex m_objSettingsMutex
Definition: datvdemod.h:432
ChannelAPI(const QString &name, StreamType streamType)
Definition: channelapi.cpp:23
DATVideostream * m_objVideoStream
Definition: datvdemod.h:407
bool m_blnStartStopVideo
Definition: datvdemod.h:419
DATVDemodSettings::DATVModulation m_enmModulation
Definition: datvdemod.h:424
DATVideoRenderThread * m_objRenderThread
Definition: datvdemod.h:409
Exposes a single sink stream (input, Rx)
Definition: channelapi.h:41
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
DownChannelizer * m_channelizer
Definition: datvdemod.h:402
void addChannelSink(ThreadedBasebandSampleSink *sink, int streamIndex=0)
Add a channel sink (Rx)
Definition: deviceapi.cpp:118
fftfilt * m_objRFFilter
Definition: datvdemod.h:414
void CleanUpDATVFramework(bool blnRelease)
Definition: datvdemod.cpp:205
ThreadedBasebandSampleSink * m_threadedChannelizer
Definition: datvdemod.h:401
int m_sampleRate
Definition: datvdemod.h:428
TVScreen * m_objRegisteredTVScreen
Definition: datvdemod.h:405
int m_modcodModulation
Definition: datvdemod.h:421
#define rfFilterFftLength
Definition: datvdemod.h:27
AudioFifo m_audioFifo
Definition: datvdemod.h:412
+ Here is the call graph for this function:

◆ ~DATVDemod()

DATVDemod::~DATVDemod ( )

Definition at line 80 of file datvdemod.cpp.

References CleanUpDATVFramework(), DSPEngine::getAudioDeviceManager(), DSPEngine::instance(), m_audioFifo, m_blnInitialized, m_channelizer, m_deviceAPI, m_objRenderThread, m_objRFFilter, m_objVideoStream, m_threadedChannelizer, AudioDeviceManager::removeAudioSink(), DeviceAPI::removeChannelSink(), DeviceAPI::removeChannelSinkAPI(), DATVideoRenderThread::stopRendering(), and DATVideostream::ThreadTimeOut.

81 {
82  m_blnInitialized=false;
83 
84  if(m_objVideoStream!=nullptr)
85  {
86  //Immediately exit from DATVideoStream if waiting for data before killing thread
88  }
89 
91 
92  if(m_objRenderThread!=nullptr)
93  {
94  if(m_objRenderThread->isRunning())
95  {
97  m_objRenderThread->quit();
98  }
99 
100  m_objRenderThread->wait(2000);
101  }
102 
103  CleanUpDATVFramework(true);
104 
107  delete m_threadedChannelizer;
108  delete m_channelizer;
109  delete m_objRFFilter;
110 }
void removeChannelSinkAPI(ChannelAPI *channelAPI, int streamIndex=0)
Definition: deviceapi.cpp:163
void removeAudioSink(AudioFifo *audioFifo)
Remove the audio sink.
bool m_blnInitialized
Definition: datvdemod.h:417
DeviceAPI * m_deviceAPI
Definition: datvdemod.h:399
static DSPEngine * instance()
Definition: dspengine.cpp:51
void removeChannelSink(ThreadedBasebandSampleSink *sink, int streamIndex=0)
Remove a channel sink (Rx)
Definition: deviceapi.cpp:127
DATVideostream * m_objVideoStream
Definition: datvdemod.h:407
DATVideoRenderThread * m_objRenderThread
Definition: datvdemod.h:409
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
DownChannelizer * m_channelizer
Definition: datvdemod.h:402
fftfilt * m_objRFFilter
Definition: datvdemod.h:414
void CleanUpDATVFramework(bool blnRelease)
Definition: datvdemod.cpp:205
ThreadedBasebandSampleSink * m_threadedChannelizer
Definition: datvdemod.h:401
AudioFifo m_audioFifo
Definition: datvdemod.h:412
+ Here is the call graph for this function:

Member Function Documentation

◆ applyChannelSettings()

void DATVDemod::applyChannelSettings ( int  inputSampleRate,
int  inputFrequencyOffset,
bool  force = false 
)
private

Definition at line 1356 of file datvdemod.cpp.

References applySettings(), fftfilt::create_filter(), DATVDemodSettings::m_centerFrequency, m_objNCO, m_objRFFilter, DATVDemodSettings::m_rfBandwidth, m_sampleRate, m_settings, and NCO::setFreq().

Referenced by handleMessage().

1357 {
1358  qDebug() << "DATVDemod::applyChannelSettings:"
1359  << " inputSampleRate: " << inputSampleRate
1360  << " inputFrequencyOffset: " << inputFrequencyOffset;
1361 
1362  bool callApplySettings = false;
1363 
1364  if ((m_settings.m_centerFrequency != inputFrequencyOffset) ||
1365  (m_sampleRate != inputSampleRate) || force)
1366  {
1367  m_objNCO.setFreq(-(float) inputFrequencyOffset, (float) inputSampleRate);
1368  qDebug("DATVDemod::applyChannelSettings: NCO: IF: %d <> TF: %d ISR: %d",
1369  inputFrequencyOffset, m_settings.m_centerFrequency, inputSampleRate);
1370  callApplySettings = true;
1371  }
1372 
1373  if ((m_sampleRate != inputSampleRate) || force)
1374  {
1375  //Bandpass filter shaping
1376  Real fltLowCut = -((float) m_settings.m_rfBandwidth / 2.0) / (float) inputSampleRate;
1377  Real fltHiCut = ((float) m_settings.m_rfBandwidth / 2.0) / (float) inputSampleRate;
1378  m_objRFFilter->create_filter(fltLowCut, fltHiCut);
1379  }
1380 
1381  m_sampleRate = inputSampleRate;
1382  m_settings.m_centerFrequency = inputFrequencyOffset;
1383 
1384  if (callApplySettings) {
1385  applySettings(m_settings, true);
1386  }
1387 }
void applySettings(const DATVDemodSettings &settings, bool force=false)
Definition: datvdemod.cpp:1389
void create_filter(float f1, float f2)
Definition: fftfilt.cpp:107
void setFreq(Real freq, Real sampleRate)
Definition: nco.cpp:49
NCO m_objNCO
Definition: datvdemod.h:415
fftfilt * m_objRFFilter
Definition: datvdemod.h:414
int m_sampleRate
Definition: datvdemod.h:428
DATVDemodSettings m_settings
Definition: datvdemod.h:427
float Real
Definition: dsptypes.h:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applySettings()

void DATVDemod::applySettings ( const DATVDemodSettings settings,
bool  force = false 
)
private

Definition at line 1389 of file datvdemod.cpp.

References AudioDeviceManager::addAudioSink(), fftfilt::create_filter(), DATVDemodSettings::debug(), DSPEngine::getAudioDeviceManager(), BasebandSampleSink::getInputMessageQueue(), AudioDeviceManager::getOutputDeviceIndex(), DSPEngine::instance(), DATVDemodSettings::isDifferent(), DATVDemodSettings::m_audioDeviceName, m_audioFifo, DATVDemodSettings::m_audioMute, DATVDemodSettings::m_audioVolume, m_blnNeedConfigUpdate, DATVDemodSettings::m_centerFrequency, m_objNCO, m_objRegisteredVideoRender, m_objRFFilter, DATVDemodSettings::m_rfBandwidth, m_sampleRate, m_settings, m_udpStream, DATVDemodSettings::m_udpTS, DATVDemodSettings::m_udpTSAddress, DATVDemodSettings::m_udpTSPort, DATVDemodSettings::m_videoMute, DATVUDPStream::setActive(), DATVUDPStream::setAddress(), DATVideoRender::setAudioMute(), DATVideoRender::setAudioVolume(), NCO::setFreq(), DATVUDPStream::setPort(), and DATVideoRender::setVideoMute().

Referenced by applyChannelSettings(), and handleMessage().

1390 {
1391  QString msg = tr("DATVDemod::applySettings: force: %1").arg(force);
1392  settings.debug(msg);
1393 
1394  qDebug("DATVDemod::applySettings: m_sampleRate: %d", m_sampleRate);
1395 
1396  if (m_sampleRate == 0) {
1397  return;
1398  }
1399 
1400  if ((settings.m_audioDeviceName != m_settings.m_audioDeviceName) || force)
1401  {
1403  int audioDeviceIndex = audioDeviceManager->getOutputDeviceIndex(settings.m_audioDeviceName);
1404  audioDeviceManager->addAudioSink(&m_audioFifo, getInputMessageQueue(), audioDeviceIndex); // removes from current if necessary
1405  // uint32_t audioSampleRate = audioDeviceManager->getOutputSampleRate(audioDeviceIndex);
1406 
1407  // if (m_audioSampleRate != audioSampleRate) {
1408  // applyAudioSampleRate(audioSampleRate);
1409  // }
1410  }
1411 
1412  if ((settings.m_audioVolume) != (m_settings.m_audioVolume) || force)
1413  {
1416  }
1417  }
1418 
1419  if ((settings.m_audioMute) != (m_settings.m_audioMute) || force)
1420  {
1423  }
1424  }
1425 
1426  if ((settings.m_videoMute) != (m_settings.m_videoMute) || force)
1427  {
1430  }
1431  }
1432 
1433  if ((m_settings.m_rfBandwidth != settings.m_rfBandwidth)
1434  || force)
1435  {
1436 
1437  //Bandpass filter shaping
1438  Real fltLowCut = -((float) settings.m_rfBandwidth / 2.0) / (float) m_sampleRate;
1439  Real fltHiCut = ((float) settings.m_rfBandwidth / 2.0) / (float) m_sampleRate;
1440  m_objRFFilter->create_filter(fltLowCut, fltHiCut);
1441  }
1442 
1444  || force)
1445  {
1446  m_objNCO.setFreq(-(float) settings.m_centerFrequency, (float) m_sampleRate);
1447  }
1448 
1449  if ((m_settings.m_udpTS != settings.m_udpTS) || force) {
1450  m_udpStream.setActive(settings.m_udpTS);
1451  }
1452 
1453  if ((m_settings.m_udpTSAddress != settings.m_udpTSAddress) || force) {
1455  }
1456 
1457  if ((m_settings.m_udpTSPort != settings.m_udpTSPort) || force) {
1458  m_udpStream.setPort(settings.m_udpTSPort);
1459  }
1460 
1461  if (m_settings.isDifferent(settings) || force)
1462  {
1463  m_blnNeedConfigUpdate = true;
1464  }
1465 
1466  m_settings = settings;
1467 }
bool isDifferent(const DATVDemodSettings &other)
void addAudioSink(AudioFifo *audioFifo, MessageQueue *sampleSinkMessageQueue, int outputDeviceIndex=-1)
Add the audio sink.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void setPort(quint16 port)
Definition: datvudpstream.h:37
bool m_blnNeedConfigUpdate
Definition: datvdemod.h:296
int getOutputDeviceIndex(const QString &deviceName) const
bool setAddress(const QString &address)
Definition: datvudpstream.h:36
void debug(const QString &msg) const
DATVideoRender * m_objRegisteredVideoRender
Definition: datvdemod.h:406
void create_filter(float f1, float f2)
Definition: fftfilt.cpp:107
static DSPEngine * instance()
Definition: dspengine.cpp:51
DATVUDPStream m_udpStream
Definition: datvdemod.h:408
void setAudioMute(bool audioMute)
void setFreq(Real freq, Real sampleRate)
Definition: nco.cpp:49
NCO m_objNCO
Definition: datvdemod.h:415
void setAudioVolume(int audioVolume)
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
fftfilt * m_objRFFilter
Definition: datvdemod.h:414
int m_sampleRate
Definition: datvdemod.h:428
void setActive(bool active)
Definition: datvudpstream.h:35
DATVDemodSettings m_settings
Definition: datvdemod.h:427
void setVideoMute(bool videoMute)
float Real
Definition: dsptypes.h:42
AudioFifo m_audioFifo
Definition: datvdemod.h:412
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioActive()

bool DATVDemod::audioActive ( )

Definition at line 126 of file datvdemod.cpp.

References DATVideoRender::getAudioStreamIndex(), and m_objRegisteredVideoRender.

Referenced by DATVDemodGUI::tick().

127 {
130  } else {
131  return false;
132  }
133 }
DATVideoRender * m_objRegisteredVideoRender
Definition: datvdemod.h:406
int getAudioStreamIndex() const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioDecodeOK()

bool DATVDemod::audioDecodeOK ( )

Definition at line 144 of file datvdemod.cpp.

References DATVideoRender::getAudioDecodeOK(), and m_objRegisteredVideoRender.

Referenced by DATVDemodGUI::tick().

145 {
148  } else {
149  return false;
150  }
151 }
DATVideoRender * m_objRegisteredVideoRender
Definition: datvdemod.h:406
bool getAudioDecodeOK() const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CleanUpDATVFramework()

void DATVDemod::CleanUpDATVFramework ( bool  blnRelease)

Definition at line 205 of file datvdemod.cpp.

References coeffs, coeffs_sampler, m_objDemodulator, m_objDemodulatorDVBS2, m_objScheduler, ncoeffs, ncoeffs_sampler, p_autonotched, p_bbframes, p_bytes, p_cnr, p_cstln, p_cstln_pls, p_decim, p_decimated, p_deframer, p_derot, p_descrambled, p_fecframes, p_framelock, p_frames, p_freq, p_lock, p_locktime, p_mer, p_mpegbytes, p_preprocessed, p_rawiq, p_rawiq_writer, p_resampled, p_rspackets, p_rtspackets, p_s2_deinterleaver, p_sampled, p_slots_dvbs2, p_ss, p_symbols, p_tspackets, p_vber, p_vbitcount, p_verrcount, r, r_auto_notch, r_cnr, r_deconv, r_deinter, r_derand, r_derot, r_etr192_descrambler, r_fecdec, r_ppout, r_resample, r_rsdec, r_scope_symbols, r_scope_symbols_dvbs2, r_stdout, r_sync, r_sync_mpeg, r_vber, r_videoplayer, sampler, and leansdr::scheduler::shutdown().

Referenced by InitDATVFramework(), InitDATVS2Framework(), and ~DATVDemod().

206 {
207  if (blnRelease == true)
208  {
209  if (m_objScheduler != nullptr)
210  {
212  delete m_objScheduler;
213  }
214 
215  // NOTCH FILTER
216 
217  if (r_auto_notch != nullptr) {
218  delete r_auto_notch;
219  }
220  if (p_autonotched != nullptr) {
221  delete p_autonotched;
222  }
223 
224  // FREQUENCY CORRECTION : DEROTATOR
225  if (p_derot != nullptr) {
226  delete p_derot;
227  }
228  if (r_derot != nullptr) {
229  delete r_derot;
230  }
231 
232  // CNR ESTIMATION
233  if (p_cnr != nullptr) {
234  delete p_cnr;
235  }
236  if (r_cnr != nullptr) {
237  delete r_cnr;
238  }
239 
240  //FILTERING
241  if (r_resample != nullptr) {
242  delete r_resample;
243  }
244  if (p_resampled != nullptr) {
245  delete p_resampled;
246  }
247  if (coeffs != nullptr) {
248  delete coeffs;
249  }
250 
251  // OUTPUT PREPROCESSED DATA
252  if (sampler != nullptr) {
253  delete sampler;
254  }
255  if (coeffs_sampler != nullptr) {
256  delete coeffs_sampler;
257  }
258  if (p_symbols != nullptr) {
259  delete p_symbols;
260  }
261  if (p_freq != nullptr) {
262  delete p_freq;
263  }
264  if (p_ss != nullptr) {
265  delete p_ss;
266  }
267  if (p_mer != nullptr) {
268  delete p_mer;
269  }
270  if (p_sampled != nullptr) {
271  delete p_sampled;
272  }
273 
274  //DECIMATION
275  if (p_decimated != nullptr) {
276  delete p_decimated;
277  }
278  if (p_decim != nullptr) {
279  delete p_decim;
280  }
281  if (r_ppout != nullptr) {
282  delete r_ppout;
283  }
284 
285  //GENERIC CONSTELLATION RECEIVER
286  if (m_objDemodulator != nullptr) {
287  delete m_objDemodulator;
288  }
289 
290  //DECONVOLUTION AND SYNCHRONIZATION
291  if (p_bytes != nullptr) {
292  delete p_bytes;
293  }
294  if (r_deconv != nullptr) {
295  delete r_deconv;
296  }
297  if (r != nullptr) {
298  delete r;
299  }
300  if (p_descrambled != nullptr) {
301  delete p_descrambled;
302  }
303  if (p_frames != nullptr) {
304  delete p_frames;
305  }
306  if (r_etr192_descrambler != nullptr) {
307  delete r_etr192_descrambler;
308  }
309  if (r_sync != nullptr) {
310  delete r_sync;
311  }
312  if (p_mpegbytes != nullptr) {
313  delete p_mpegbytes;
314  }
315  if (p_lock != nullptr) {
316  delete p_lock;
317  }
318  if (p_locktime != nullptr) {
319  delete p_locktime;
320  }
321  if (r_sync_mpeg != nullptr) {
322  delete r_sync_mpeg;
323  }
324 
325  // DEINTERLEAVING
326  if (p_rspackets != nullptr) {
327  delete p_rspackets;
328  }
329  if (r_deinter != nullptr) {
330  delete r_deinter;
331  }
332  if (p_vbitcount != nullptr) {
333  delete p_vbitcount;
334  }
335  if (p_verrcount != nullptr) {
336  delete p_verrcount;
337  }
338  if (p_rtspackets != nullptr) {
339  delete p_rtspackets;
340  }
341  if (r_rsdec != nullptr) {
342  delete r_rsdec;
343  }
344 
345  //BER ESTIMATION
346  if (p_vber != nullptr) {
347  delete p_vber;
348  }
349  if (r_vber != nullptr) {
350  delete r_vber;
351  }
352 
353  // DERANDOMIZATION
354  if (p_tspackets != nullptr) {
355  delete p_tspackets;
356  }
357  if (r_derand != nullptr) {
358  delete r_derand;
359  }
360 
361  //OUTPUT : To remove
362  if (r_stdout != nullptr) {
363  delete r_stdout;
364  }
365  if (r_videoplayer != nullptr) {
366  delete r_videoplayer;
367  }
368 
369  //CONSTELLATION
370  if (r_scope_symbols != nullptr) {
371  delete r_scope_symbols;
372  }
373 
374  // INPUT
375  //if(p_rawiq!=nullptr) delete p_rawiq;
376  //if(p_rawiq_writer!=nullptr) delete p_rawiq_writer;
377  //if(p_preprocessed!=nullptr) delete p_preprocessed;
378 
379  //DVB-S2
380 
381  if(p_slots_dvbs2 != nullptr)
382  {
384  }
385 
386  if(p_cstln != nullptr)
387  {
388  delete p_cstln;
389  }
390 
391  if(p_cstln_pls != nullptr)
392  {
393  delete p_cstln_pls;
394  }
395 
396  if(p_framelock != nullptr)
397  {
398  delete p_framelock;
399  }
400 
401  if(m_objDemodulatorDVBS2 != nullptr)
402  {
404  }
405 
406  if(p_fecframes != nullptr)
407  {
409  }
410 
411  if(p_bbframes != nullptr)
412  {
414  }
415 
416  if(p_s2_deinterleaver != nullptr)
417  {
419  }
420 
421  if(r_fecdec != nullptr)
422  {
424  }
425 
426  if(p_deframer != nullptr)
427  {
429  }
430 
431  if(r_scope_symbols_dvbs2 != nullptr)
432  {
433  delete r_scope_symbols_dvbs2;
434  }
435  }
436 
437  m_objScheduler=nullptr;
438 
439  // INPUT
440 
441  p_rawiq = nullptr;
442  p_rawiq_writer = nullptr;
443 
444  p_preprocessed = nullptr;
445 
446  // NOTCH FILTER
447  r_auto_notch = nullptr;
448  p_autonotched = nullptr;
449 
450  // FREQUENCY CORRECTION : DEROTATOR
451  p_derot = nullptr;
452  r_derot=nullptr;
453 
454  // CNR ESTIMATION
455  p_cnr = nullptr;
456  r_cnr = nullptr;
457 
458  //FILTERING
459  r_resample = nullptr;
460  p_resampled = nullptr;
461  coeffs = nullptr;
462  ncoeffs=0;
463 
464  // OUTPUT PREPROCESSED DATA
465  sampler = nullptr;
466  coeffs_sampler=nullptr;
467  ncoeffs_sampler=0;
468 
469  p_symbols = nullptr;
470  p_freq = nullptr;
471  p_ss = nullptr;
472  p_mer = nullptr;
473  p_sampled = nullptr;
474 
475  //DECIMATION
476  p_decimated = nullptr;
477  p_decim = nullptr;
478  r_ppout = nullptr;
479 
480  //GENERIC CONSTELLATION RECEIVER
481  m_objDemodulator = nullptr;
482 
483  //DECONVOLUTION AND SYNCHRONIZATION
484  p_bytes=nullptr;
485  r_deconv=nullptr;
486  r = nullptr;
487 
488  p_descrambled = nullptr;
489  p_frames = nullptr;
490  r_etr192_descrambler = nullptr;
491  r_sync = nullptr;
492 
493  p_mpegbytes = nullptr;
494  p_lock = nullptr;
495  p_locktime = nullptr;
496  r_sync_mpeg = nullptr;
497 
498 
499  // DEINTERLEAVING
500  p_rspackets = nullptr;
501  r_deinter = nullptr;
502 
503  p_vbitcount = nullptr;
504  p_verrcount = nullptr;
505  p_rtspackets = nullptr;
506  r_rsdec = nullptr;
507 
508 
509  //BER ESTIMATION
510  p_vber = nullptr;
511  r_vber = nullptr;
512 
513 
514  // DERANDOMIZATION
515  p_tspackets = nullptr;
516  r_derand = nullptr;
517 
518 
519  //OUTPUT : To remove void *
520  r_stdout = nullptr;
521  r_videoplayer = nullptr;
522 
523 
524  //CONSTELLATION
525  r_scope_symbols = nullptr;
526 
527  //DVB-S2
528  p_slots_dvbs2 = nullptr;
529  p_cstln = nullptr;
530  p_cstln_pls = nullptr;
531  p_framelock = nullptr;
532  m_objDemodulatorDVBS2 = nullptr;
533  p_fecframes = nullptr;
534  p_bbframes = nullptr;
535  p_s2_deinterleaver = nullptr;
536  r_fecdec = nullptr;
537  p_deframer = nullptr;
538  r_scope_symbols_dvbs2 = nullptr;
539 }
leansdr::pipebuf< leansdr::u8 > * p_bytes
Definition: datvdemod.h:357
leansdr::pipebuf< leansdr::f32 > * p_ss
Definition: datvdemod.h:330
leansdr::pipebuf< int > * p_lock
Definition: datvdemod.h:367
leansdr::rs_decoder< leansdr::u8, 0 > * r_rsdec
Definition: datvdemod.h:380
void * p_deframer
Definition: datvdemod.h:344
leansdr::pipebuf< leansdr::u32 > * p_locktime
Definition: datvdemod.h:368
void * p_fecframes
Definition: datvdemod.h:340
leansdr::pipebuf< leansdr::u8 > * p_mpegbytes
Definition: datvdemod.h:366
leansdr::pipebuf< leansdr::tspacket > * p_rtspackets
Definition: datvdemod.h:379
leansdr::pipebuf< int > * p_vbitcount
Definition: datvdemod.h:377
leansdr::pipebuf< leansdr::rspacket< leansdr::u8 > > * p_rspackets
Definition: datvdemod.h:373
leansdr::rotator< leansdr::f32 > * r_derot
Definition: datvdemod.h:311
void * m_objDemodulatorDVBS2
Definition: datvdemod.h:339
leansdr::datvdvbs2constellation< leansdr::f32 > * r_scope_symbols_dvbs2
Definition: datvdemod.h:397
leansdr::pipebuf< leansdr::f32 > * p_cnr
Definition: datvdemod.h:314
leansdr::pipewriter< leansdr::cf32 > * p_rawiq_writer
Definition: datvdemod.h:302
leansdr::pipebuf< leansdr::u8 > * p_descrambled
Definition: datvdemod.h:360
leansdr::pipebuf< leansdr::f32 > * p_freq
Definition: datvdemod.h:329
leansdr::pipebuf< leansdr::eucl_ss > * p_symbols
Definition: datvdemod.h:328
leansdr::datvvideoplayer< leansdr::tspacket > * r_videoplayer
Definition: datvdemod.h:393
leansdr::decimator< leansdr::cf32 > * p_decim
Definition: datvdemod.h:348
int ncoeffs_sampler
Definition: datvdemod.h:326
leansdr::pipebuf< leansdr::cf32 > * p_autonotched
Definition: datvdemod.h:307
leansdr::cnr_fft< leansdr::f32 > * r_cnr
Definition: datvdemod.h:315
leansdr::mpeg_sync< leansdr::u8, 0 > * r_sync_mpeg
Definition: datvdemod.h:369
int ncoeffs
Definition: datvdemod.h:321
leansdr::viterbi_sync * r
Definition: datvdemod.h:359
leansdr::etr192_descrambler * r_etr192_descrambler
Definition: datvdemod.h:363
leansdr::deinterleaver< leansdr::u8 > * r_deinter
Definition: datvdemod.h:374
leansdr::pipebuf< int > * p_framelock
Definition: datvdemod.h:338
leansdr::auto_notch< leansdr::f32 > * r_auto_notch
Definition: datvdemod.h:306
leansdr::pipebuf< leansdr::cf32 > * p_rawiq
Definition: datvdemod.h:301
leansdr::deconvol_sync_simple * r_deconv
Definition: datvdemod.h:358
leansdr::file_writer< leansdr::cf32 > * r_ppout
Definition: datvdemod.h:351
leansdr::pipebuf< leansdr::cf32 > * p_cstln
Definition: datvdemod.h:336
leansdr::datvconstellation< leansdr::f32 > * r_scope_symbols
Definition: datvdemod.h:396
void * p_s2_deinterleaver
Definition: datvdemod.h:342
leansdr::pipebuf< float > * p_vber
Definition: datvdemod.h:383
leansdr::rate_estimator< float > * r_vber
Definition: datvdemod.h:384
void * r_fecdec
Definition: datvdemod.h:343
leansdr::pipebuf< int > * p_verrcount
Definition: datvdemod.h:378
leansdr::scheduler * m_objScheduler
Definition: datvdemod.h:292
void * p_slots_dvbs2
Definition: datvdemod.h:335
leansdr::pipebuf< leansdr::cf32 > * p_resampled
Definition: datvdemod.h:319
leansdr::hdlc_sync * r_sync
Definition: datvdemod.h:364
leansdr::pipebuf< leansdr::u8 > * p_frames
Definition: datvdemod.h:361
leansdr::pipebuf< leansdr::cf32 > * p_preprocessed
Definition: datvdemod.h:303
leansdr::pipebuf< leansdr::tspacket > * p_tspackets
Definition: datvdemod.h:387
leansdr::pipebuf< leansdr::cf32 > * p_cstln_pls
Definition: datvdemod.h:337
leansdr::file_writer< leansdr::tspacket > * r_stdout
Definition: datvdemod.h:392
float * coeffs
Definition: datvdemod.h:320
leansdr::sampler_interface< leansdr::f32 > * sampler
Definition: datvdemod.h:324
leansdr::derandomizer * r_derand
Definition: datvdemod.h:388
leansdr::pipebuf< leansdr::f32 > * p_mer
Definition: datvdemod.h:331
leansdr::fir_filter< leansdr::cf32, float > * r_resample
Definition: datvdemod.h:318
leansdr::pipebuf< leansdr::cf32 > * p_decimated
Definition: datvdemod.h:347
leansdr::cstln_receiver< leansdr::f32, leansdr::eucl_ss > * m_objDemodulator
Definition: datvdemod.h:354
leansdr::pipebuf< leansdr::cf32 > * p_sampled
Definition: datvdemod.h:332
float * coeffs_sampler
Definition: datvdemod.h:325
leansdr::pipebuf< leansdr::cf32 > * p_derot
Definition: datvdemod.h:310
void * p_bbframes
Definition: datvdemod.h:341
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

virtual bool DATVDemod::deserialize ( const QByteArray &  data)
inlinevirtual

Implements ChannelAPI.

Definition at line 140 of file datvdemod.h.

140 { (void) data; return false; }

◆ destroy()

virtual void DATVDemod::destroy ( )
inlinevirtual

Implements ChannelAPI.

Definition at line 134 of file datvdemod.h.

134 { delete this; }

◆ feed()

void DATVDemod::feed ( const SampleVector::const_iterator &  begin,
const SampleVector::const_iterator &  end,
bool  po 
)
virtual

Implements BasebandSampleSink.

Definition at line 1154 of file datvdemod.cpp.

References leansdr::datvdvbs2constellation< T >::calculate_cstln_points(), DATVDemod::MsgReportModcodCstlnChange::create(), leansdr::s2_frame_receiver< T, SOFTSYMB >::cstln, DATVDemodSettings::DVB_S2, getCodeRateFromLeanDVBCode(), BasebandSampleSink::getMessageQueueToGUI(), getModulationFromLeanDVBCode(), leansdr::complex< T >::im, InitDATVFramework(), InitDATVS2Framework(), m_blnDVBInitialized, m_blnNeedConfigUpdate, m_cstlnSetByModcod, m_lngReadIQ, m_modcodCodeRate, m_modcodModulation, leansdr::s2_frame_receiver< T, SOFTSYMB >::m_modcodRate, leansdr::s2_frame_receiver< T, SOFTSYMB >::m_modcodType, m_objDemodulatorDVBS2, m_objMagSqAverage, m_objNCO, m_objRFFilter, m_objScheduler, m_objSettingsMutex, m_settings, DATVDemodSettings::m_standard, NCO::nextIQ(), p_rawiq_writer, MessageQueue::push(), r_scope_symbols_dvbs2, leansdr::complex< T >::re, fftfilt::runFilt(), and leansdr::scheduler::step().

1155 {
1156  (void) firstOfBurst;
1157  float fltI;
1158  float fltQ;
1159  leansdr::cf32 objIQ;
1160  //Complex objC;
1161  fftfilt::cmplx *objRF;
1162  int intRFOut;
1163  double magSq;
1164 
1165  int lngWritable=0;
1166 
1167  //********** Bis repetita : Let's rock and roll buddy ! **********
1168 
1169 #ifdef EXTENDED_DIRECT_SAMPLE
1170 
1171  qint16 * ptrBuffer;
1172  qint32 intLen;
1173 
1174  //********** Reading direct samples **********
1175 
1176  SampleVector::const_iterator it = begin;
1177  intLen = it->intLen;
1178  ptrBuffer = it->ptrBuffer;
1179  ptrBufferToRelease = ptrBuffer;
1180  ++it;
1181 
1182  for(qint32 intInd=0; intInd<intLen-1; intInd +=2)
1183  {
1184 
1185  fltI= ((qint32) (*ptrBuffer)) << 4;
1186  ptrBuffer ++;
1187  fltQ= ((qint32) (*ptrBuffer)) << 4;
1188  ptrBuffer ++;
1189 
1190 #else
1191 
1192  for (SampleVector::const_iterator it = begin; it != end; ++it /* ++it **/)
1193  {
1194  fltI = it->real();
1195  fltQ = it->imag();
1196 #endif
1197 
1198 
1199  //********** demodulation **********
1200 
1201 
1203  {
1204  qDebug("DATVDemod::feed: Settings applied. Standard : %d...", m_settings.m_standard);
1205  m_objSettingsMutex.lock();
1206  m_blnNeedConfigUpdate=false;
1207 
1209  {
1210  printf("SWITCHING TO DVBS-2\r\n");
1212  }
1213  else
1214  {
1215  printf("SWITCHING TO DVBS\r\n");
1217  }
1218 
1219  m_objSettingsMutex.unlock();
1220  }
1221 
1222 
1223  //********** iq stream ****************
1224 
1225  Complex objC(fltI,fltQ);
1226 
1227  objC *= m_objNCO.nextIQ();
1228 
1229  intRFOut = m_objRFFilter->runFilt(objC, &objRF); // filter RF before demod
1230 
1231  for (int intI = 0 ; intI < intRFOut; intI++)
1232  {
1233  objIQ.re = objRF->real();
1234  objIQ.im = objRF->imag();
1235  magSq = objIQ.re*objIQ.re + objIQ.im*objIQ.im;
1236  m_objMagSqAverage(magSq);
1237 
1238  objRF ++;
1239 
1241  && (p_rawiq_writer!=nullptr)
1242  && (m_objScheduler!=nullptr))
1243  {
1244  p_rawiq_writer->write(objIQ);
1245  m_lngReadIQ++;
1246 
1247  lngWritable = p_rawiq_writer->writable();
1248 
1249  //Leave +1 by safety
1250  //if(((m_lngReadIQ+1)>=lngWritable) || (m_lngReadIQ>=768))
1251  if((m_lngReadIQ+1)>=lngWritable)
1252  {
1253  m_objScheduler->step();
1254 
1255  m_lngReadIQ=0;
1256  //delete p_rawiq_writer;
1257  //p_rawiq_writer = new leansdr::pipewriter<leansdr::cf32>(*p_rawiq);
1258  }
1259  }
1260 
1261  }
1262  } // Samples for loop
1263 
1264  // DVBS2: Track change of constellation via MODCOD
1266  {
1268 
1269  if (objDemodulatorDVBS2->cstln->m_setByModcod && !m_cstlnSetByModcod)
1270  {
1271  qDebug("DATVDemod::feed: change by MODCOD detected");
1272 
1273  if (r_scope_symbols_dvbs2) {
1275  }
1276 
1277  if (getMessageQueueToGUI())
1278  {
1279  MsgReportModcodCstlnChange *msg = MsgReportModcodCstlnChange::create(
1280  getModulationFromLeanDVBCode(objDemodulatorDVBS2->cstln->m_typeCode),
1281  getCodeRateFromLeanDVBCode(objDemodulatorDVBS2->cstln->m_rateCode)
1282  );
1283 
1284  getMessageQueueToGUI()->push(msg);
1285  }
1286  }
1287 
1288  m_cstlnSetByModcod = objDemodulatorDVBS2->cstln->m_setByModcod;
1289  m_modcodModulation = objDemodulatorDVBS2->m_modcodType;
1290  m_modcodCodeRate = objDemodulatorDVBS2->m_modcodRate;
1291  }
1292 }
bool m_cstlnSetByModcod
Definition: datvdemod.h:420
Complex nextIQ()
Return next complex sample.
Definition: nco.cpp:61
void push(Message *message, bool emitSignal=true)
Push message onto queue.
void * m_objDemodulatorDVBS2
Definition: datvdemod.h:339
leansdr::datvdvbs2constellation< leansdr::f32 > * r_scope_symbols_dvbs2
Definition: datvdemod.h:397
leansdr::pipewriter< leansdr::cf32 > * p_rawiq_writer
Definition: datvdemod.h:302
bool m_blnNeedConfigUpdate
Definition: datvdemod.h:296
int runFilt(const cmplx &in, cmplx **out)
Definition: fftfilt.cpp:260
bool m_blnDVBInitialized
Definition: datvdemod.h:295
static DATVDemodSettings::DATVModulation getModulationFromLeanDVBCode(int leanDVBModulation)
Definition: datvdemod.cpp:1507
std::complex< float > cmplx
Definition: fftfilt.h:21
void InitDATVS2Framework()
Definition: datvdemod.cpp:869
cstln_lut< SOFTSYMB, 256 > * cstln
Definition: dvbs2.h:1153
int m_modcodCodeRate
Definition: datvdemod.h:422
long m_lngReadIQ
Definition: datvdemod.h:272
static DATVDemodSettings::DATVCodeRate getCodeRateFromLeanDVBCode(int leanDVBCodeRate)
Definition: datvdemod.cpp:1474
QMutex m_objSettingsMutex
Definition: datvdemod.h:432
NCO m_objNCO
Definition: datvdemod.h:415
static MsgReportModcodCstlnChange * create(const DATVDemodSettings::DATVModulation &modulation, const DATVDemodSettings::DATVCodeRate &codeRate)
Definition: datvdemod.h:250
leansdr::scheduler * m_objScheduler
Definition: datvdemod.h:292
MessageQueue * getMessageQueueToGUI()
MovingAverageUtil< double, double, 32 > m_objMagSqAverage
Definition: datvdemod.h:430
fftfilt * m_objRFFilter
Definition: datvdemod.h:414
DATVDemodSettings m_settings
Definition: datvdemod.h:427
std::complex< Real > Complex
Definition: dsptypes.h:43
int m_modcodModulation
Definition: datvdemod.h:421
dvb_version m_standard
void InitDATVFramework()
Definition: datvdemod.cpp:541
+ Here is the call graph for this function:

◆ getCenterFrequency()

virtual qint64 DATVDemod::getCenterFrequency ( ) const
inlinevirtual

Applies to a default stream.

Implements ChannelAPI.

Definition at line 137 of file datvdemod.h.

137 { return m_settings.m_centerFrequency; }
DATVDemodSettings m_settings
Definition: datvdemod.h:427

◆ getCodeRateFromLeanDVBCode()

DATVDemodSettings::DATVCodeRate DATVDemod::getCodeRateFromLeanDVBCode ( int  leanDVBCodeRate)
static

Definition at line 1474 of file datvdemod.cpp.

References leansdr::FEC12, leansdr::FEC13, leansdr::FEC14, leansdr::FEC23, leansdr::FEC25, leansdr::FEC34, leansdr::FEC35, leansdr::FEC45, leansdr::FEC46, leansdr::FEC56, leansdr::FEC78, leansdr::FEC89, and leansdr::FEC910.

Referenced by feed(), and DATVDemodGUI::tick().

1475 {
1476  if (leanDVBCodeRate == leansdr::code_rate::FEC12) {
1478  } else if (leanDVBCodeRate == leansdr::code_rate::FEC13) {
1480  } else if (leanDVBCodeRate == leansdr::code_rate::FEC14) {
1482  } else if (leanDVBCodeRate == leansdr::code_rate::FEC23) {
1484  } else if (leanDVBCodeRate == leansdr::code_rate::FEC25) {
1486  } else if (leanDVBCodeRate == leansdr::code_rate::FEC34) {
1488  } else if (leanDVBCodeRate == leansdr::code_rate::FEC35) {
1490  } else if (leanDVBCodeRate == leansdr::code_rate::FEC45) {
1492  } else if (leanDVBCodeRate == leansdr::code_rate::FEC46) {
1494  } else if (leanDVBCodeRate == leansdr::code_rate::FEC56) {
1496  } else if (leanDVBCodeRate == leansdr::code_rate::FEC78) {
1498  } else if (leanDVBCodeRate == leansdr::code_rate::FEC89) {
1500  } else if (leanDVBCodeRate == leansdr::code_rate::FEC910) {
1502  } else {
1503  return DATVDemodSettings::DATVCodeRate::RATE_UNSET;
1504  }
1505 }
+ Here is the caller graph for this function:

◆ getIdentifier()

virtual void DATVDemod::getIdentifier ( QString &  id)
inlinevirtual

Implements ChannelAPI.

Definition at line 135 of file datvdemod.h.

135 { id = objectName(); }

◆ getLeanDVBCodeRateFromDATV()

int DATVDemod::getLeanDVBCodeRateFromDATV ( DATVDemodSettings::DATVCodeRate  datvCodeRate)
static

Definition at line 1532 of file datvdemod.cpp.

References leansdr::FEC12, leansdr::FEC13, leansdr::FEC14, leansdr::FEC23, leansdr::FEC25, leansdr::FEC34, leansdr::FEC35, leansdr::FEC45, leansdr::FEC46, leansdr::FEC56, leansdr::FEC78, leansdr::FEC89, and leansdr::FEC910.

Referenced by InitDATVFramework(), and InitDATVS2Framework().

1533 {
1534  if (datvCodeRate == DATVDemodSettings::DATVCodeRate::FEC12) {
1535  return (int) leansdr::code_rate::FEC12;
1536  } else if (datvCodeRate == DATVDemodSettings::DATVCodeRate::FEC13) {
1537  return (int) leansdr::code_rate::FEC13;
1538  } else if (datvCodeRate == DATVDemodSettings::DATVCodeRate::FEC14) {
1539  return (int) leansdr::code_rate::FEC14;
1540  } else if (datvCodeRate == DATVDemodSettings::DATVCodeRate::FEC23) {
1541  return (int) leansdr::code_rate::FEC23;
1542  } else if (datvCodeRate == DATVDemodSettings::DATVCodeRate::FEC25) {
1543  return (int) leansdr::code_rate::FEC25;
1544  } else if (datvCodeRate == DATVDemodSettings::DATVCodeRate::FEC34) {
1545  return (int) leansdr::code_rate::FEC34;
1546  } else if (datvCodeRate == DATVDemodSettings::DATVCodeRate::FEC35) {
1547  return (int) leansdr::code_rate::FEC35;
1548  } else if (datvCodeRate == DATVDemodSettings::DATVCodeRate::FEC45) {
1549  return (int) leansdr::code_rate::FEC45;
1550  } else if (datvCodeRate == DATVDemodSettings::DATVCodeRate::FEC46) {
1551  return (int) leansdr::code_rate::FEC46;
1552  } else if (datvCodeRate == DATVDemodSettings::DATVCodeRate::FEC56) {
1553  return (int) leansdr::code_rate::FEC56;
1554  } else if (datvCodeRate == DATVDemodSettings::DATVCodeRate::FEC78) {
1555  return (int) leansdr::code_rate::FEC78;
1556  } else if (datvCodeRate == DATVDemodSettings::DATVCodeRate::FEC89) {
1557  return (int) leansdr::code_rate::FEC89;
1558  } else if (datvCodeRate == DATVDemodSettings::DATVCodeRate::FEC910) {
1559  return (int) leansdr::code_rate::FEC910;
1560  } else {
1561  return -1;
1562  }
1563 }
+ Here is the caller graph for this function:

◆ getLeanDVBModulationFromDATV()

int DATVDemod::getLeanDVBModulationFromDATV ( DATVDemodSettings::DATVModulation  datvModulation)
static

Definition at line 1565 of file datvdemod.cpp.

1566 {
1567  if (datvModulation == DATVDemodSettings::DATVModulation::APSK16) {
1568  return (int) leansdr::cstln_base::predef::APSK16;
1569  } else if (datvModulation == DATVDemodSettings::DATVModulation::APSK32) {
1570  return (int) leansdr::cstln_base::predef::APSK32;
1571  } else if (datvModulation == DATVDemodSettings::DATVModulation::APSK64E) {
1572  return (int) leansdr::cstln_base::predef::APSK64E;
1573  } else if (datvModulation == DATVDemodSettings::DATVModulation::BPSK) {
1574  return (int) leansdr::cstln_base::predef::BPSK;
1575  } else if (datvModulation == DATVDemodSettings::DATVModulation::PSK8) {
1576  return (int) leansdr::cstln_base::predef::PSK8;
1577  } else if (datvModulation == DATVDemodSettings::DATVModulation::QAM16) {
1578  return (int) leansdr::cstln_base::predef::QAM16;
1579  } else if (datvModulation == DATVDemodSettings::DATVModulation::QAM64) {
1580  return (int) leansdr::cstln_base::predef::QAM64;
1581  } else if (datvModulation == DATVDemodSettings::DATVModulation::QAM256) {
1582  return (int) leansdr::cstln_base::predef::QAM256;
1583  } else if (datvModulation == DATVDemodSettings::DATVModulation::QPSK) {
1584  return (int) leansdr::cstln_base::predef::QPSK;
1585  } else {
1586  return -1;
1587  }
1588 }

◆ getMagSq()

double DATVDemod::getMagSq ( ) const
inline

Beware this is scaled to 2^30.

Definition at line 188 of file datvdemod.h.

Referenced by DATVDemodGUI::tick().

+ Here is the caller graph for this function:

◆ getModcodCodeRate()

int DATVDemod::getModcodCodeRate ( ) const
inline

Definition at line 190 of file datvdemod.h.

Referenced by DATVDemodGUI::tick().

190 { return m_modcodCodeRate; }
int m_modcodCodeRate
Definition: datvdemod.h:422
+ Here is the caller graph for this function:

◆ getModcodModulation()

int DATVDemod::getModcodModulation ( ) const
inline

Definition at line 189 of file datvdemod.h.

Referenced by DATVDemodGUI::tick().

189 { return m_modcodModulation; }
int m_modcodModulation
Definition: datvdemod.h:421
+ Here is the caller graph for this function:

◆ getModulationFromLeanDVBCode()

DATVDemodSettings::DATVModulation DATVDemod::getModulationFromLeanDVBCode ( int  leanDVBModulation)
static

Definition at line 1507 of file datvdemod.cpp.

Referenced by feed(), and DATVDemodGUI::tick().

1508 {
1509  if (leanDVBModulation == leansdr::cstln_base::predef::APSK16) {
1510  return DATVDemodSettings::DATVModulation::APSK16;
1511  } else if (leanDVBModulation == leansdr::cstln_base::predef::APSK32) {
1512  return DATVDemodSettings::DATVModulation::APSK32;
1513  } else if (leanDVBModulation == leansdr::cstln_base::predef::APSK64E) {
1514  return DATVDemodSettings::DATVModulation::APSK64E;
1515  } else if (leanDVBModulation == leansdr::cstln_base::predef::BPSK) {
1516  return DATVDemodSettings::DATVModulation::BPSK;
1517  } else if (leanDVBModulation == leansdr::cstln_base::predef::PSK8) {
1518  return DATVDemodSettings::DATVModulation::PSK8;
1519  } else if (leanDVBModulation == leansdr::cstln_base::predef::QAM16) {
1520  return DATVDemodSettings::DATVModulation::QAM16;
1521  } else if (leanDVBModulation == leansdr::cstln_base::predef::QAM64) {
1522  return DATVDemodSettings::DATVModulation::QAM64;
1523  } else if (leanDVBModulation == leansdr::cstln_base::predef::QAM256) {
1524  return DATVDemodSettings::DATVModulation::QAM256;
1525  } else if (leanDVBModulation == leansdr::cstln_base::predef::QPSK) {
1526  return DATVDemodSettings::DATVModulation::QPSK;
1527  } else {
1528  return DATVDemodSettings::DATVModulation::MOD_UNSET;
1529  }
1530 }
+ Here is the caller graph for this function:

◆ getNbSinkStreams()

virtual int DATVDemod::getNbSinkStreams ( ) const
inlinevirtual

Implements ChannelAPI.

Definition at line 147 of file datvdemod.h.

147 { return 1; }

◆ getNbSourceStreams()

virtual int DATVDemod::getNbSourceStreams ( ) const
inlinevirtual

Implements ChannelAPI.

Definition at line 148 of file datvdemod.h.

148 { return 0; }

◆ GetSampleRate()

int DATVDemod::GetSampleRate ( )

Definition at line 1469 of file datvdemod.cpp.

References m_sampleRate.

1470 {
1471  return m_sampleRate;
1472 }
int m_sampleRate
Definition: datvdemod.h:428

◆ getStreamCenterFrequency()

virtual qint64 DATVDemod::getStreamCenterFrequency ( int  streamIndex,
bool  sinkElseSource 
) const
inlinevirtual

Implements ChannelAPI.

Definition at line 150 of file datvdemod.h.

151  {
152  (void) streamIndex;
153  (void) sinkElseSource;
155  }
DATVDemodSettings m_settings
Definition: datvdemod.h:427

◆ getTitle()

virtual void DATVDemod::getTitle ( QString &  title)
inlinevirtual

Implements ChannelAPI.

Definition at line 136 of file datvdemod.h.

136 { title = objectName(); }

◆ handleMessage()

bool DATVDemod::handleMessage ( const Message cmd)
virtual

Processing of a message. Returns true if message has actually been processed.

Implements BasebandSampleSink.

Definition at line 1303 of file datvdemod.cpp.

References applyChannelSettings(), applySettings(), DownChannelizer::configure(), DATVDemod::MsgConfigureChannelizer::getCenterFrequency(), DATVDemod::MsgConfigureDATVDemod::getForce(), DownChannelizer::MsgChannelizerNotification::getFrequencyOffset(), BasebandSampleSink::getInputMessageQueue(), DownChannelizer::getInputSampleRate(), DownChannelizer::MsgChannelizerNotification::getSampleRate(), DATVDemod::MsgConfigureDATVDemod::getSettings(), m_channelizer, m_inputFrequencyOffset, m_sampleRate, and Message::match().

1304 {
1306  {
1308 
1309  qDebug() << "DATVDemod::handleMessage: MsgChannelizerNotification:"
1310  << " m_intSampleRate: " << objNotif.getSampleRate()
1311  << " m_intFrequencyOffset: " << objNotif.getFrequencyOffset();
1312 
1314  applyChannelSettings(m_sampleRate /*objNotif.getSampleRate()*/, m_inputFrequencyOffset);
1315 
1316  return true;
1317  }
1318  else if (MsgConfigureChannelizer::match(cmd))
1319  {
1320  MsgConfigureChannelizer& cfg = (MsgConfigureChannelizer&) cmd;
1321 
1323  m_channelizer->getInputSampleRate(), // do not change sample rate
1324  cfg.getCenterFrequency());
1325 
1326  qDebug() << "DATVDemod::handleMessage: MsgConfigureChannelizer: sampleRate: " << m_channelizer->getInputSampleRate()
1327  << " centerFrequency: " << cfg.getCenterFrequency();
1328 
1330  applyChannelSettings(m_sampleRate /*objNotif.getSampleRate()*/, m_inputFrequencyOffset);
1331 
1332  return true;
1333  }
1334  else if (MsgConfigureDATVDemod::match(cmd))
1335  {
1336  MsgConfigureDATVDemod& objCfg = (MsgConfigureDATVDemod&) cmd;
1337  qDebug() << "DATVDemod::handleMessage: MsgConfigureDATVDemod";
1338  applySettings(objCfg.getSettings(), objCfg.getForce());
1339 
1340  return true;
1341  }
1342  else if(DSPSignalNotification::match(cmd))
1343  {
1345  qDebug("DATVDemod::handleMessage: DSPSignalNotification: sent sample rate: %d", m_sampleRate);
1346  applyChannelSettings(m_sampleRate /*objNotif.getSampleRate()*/, m_inputFrequencyOffset);
1347 
1348  return true;
1349  }
1350  else
1351  {
1352  return false;
1353  }
1354 }
void configure(MessageQueue *messageQueue, int sampleRate, int centerFrequency)
void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force=false)
Definition: datvdemod.cpp:1356
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void applySettings(const DATVDemodSettings &settings, bool force=false)
Definition: datvdemod.cpp:1389
static bool match(const Message *message)
Definition: message.cpp:45
int getInputSampleRate() const
DownChannelizer * m_channelizer
Definition: datvdemod.h:402
int m_sampleRate
Definition: datvdemod.h:428
int m_inputFrequencyOffset
Definition: datvdemod.h:429
+ Here is the call graph for this function:

◆ InitDATVFramework()

void DATVDemod::InitDATVFramework ( )

Definition at line 541 of file datvdemod.cpp.

References config::allow_drift, config::anf, DATVDemodSettings::APSK16, DATVDemodSettings::APSK32, DATVDemodSettings::APSK64E, DATVDemodSettings::BPSK, BUF_BASEBAND, BUF_BYTES, config::buf_factor, BUF_MPEGBYTES, BUF_PACKETS, BUF_SLOW, BUF_SYMBOLS, CleanUpDATVFramework(), config::cnr, coeffs_sampler, config::constellation, leansdr::cstln_receiver< T, SOFTSYMB >::cstln, decimation(), leansdr::cnr_fft< T >::decimation, DATVDemodSettings::DVB_S, DATVDemodSettings::DVB_S2, config::fastlock, config::fec, config::Fm, config::Fs, getLeanDVBCodeRateFromDATV(), config::hard_metric, DATVDemodSettings::m_allowDrift, m_blnDVBInitialized, DATVDemodSettings::m_excursion, DATVDemodSettings::m_fastLock, DATVDemodSettings::m_fec, DATVDemodSettings::m_filter, DATVDemodSettings::m_hardMetric, m_lngExpectedReadIQ, m_lngReadIQ, DATVDemodSettings::m_modulation, DATVDemodSettings::m_notchFilters, m_objCfg, m_objDemodulator, m_objScheduler, DATVDemodSettings::m_rollOff, m_sampleRate, m_settings, DATVDemodSettings::m_standard, DATVDemodSettings::m_symbolRate, DATVDemodSettings::m_viterbi, leansdr::max(), ncoeffs_sampler, p_autonotched, p_cnr, p_freq, p_mer, p_preprocessed, p_rawiq, p_rawiq_writer, p_sampled, p_ss, p_symbols, DATVDemodSettings::PSK8, DATVDemodSettings::QAM16, DATVDemodSettings::QAM256, DATVDemodSettings::QAM64, DATVDemodSettings::QPSK, r_auto_notch, r_cnr, config::rolloff, leansdr::filtergen::root_raised_cosine(), config::rrc_rej, config::rrc_steps, DATVDemodSettings::SAMP_LINEAR, DATVDemodSettings::SAMP_NEAREST, DATVDemodSettings::SAMP_RRC, config::sampler, sampler, config::standard, and config::viterbi.

Referenced by feed().

542 {
543  m_blnDVBInitialized = false;
544  m_lngReadIQ = 0;
545  CleanUpDATVFramework(false);
546 
547  qDebug() << "DATVDemod::InitDATVFramework:"
548  << " Standard: " << m_settings.m_standard
549  << " Symbol Rate: " << m_settings.m_symbolRate
550  << " Modulation: " << m_settings.m_modulation
551  << " Notch Filters: " << m_settings.m_notchFilters
552  << " Allow Drift: " << m_settings.m_allowDrift
553  << " Fast Lock: " << m_settings.m_fastLock
554  << " Filter: " << m_settings.m_filter
555  << " HARD METRIC: " << m_settings.m_hardMetric
556  << " RollOff: " << m_settings.m_rollOff
557  << " Viterbi: " << m_settings.m_viterbi
558  << " Excursion: " << m_settings.m_excursion
559  << " Sample rate: " << m_sampleRate;
560 
562 
564  m_objCfg.Fs = (float) m_sampleRate;
567 
570  m_objCfg.rrc_rej = (float) m_settings.m_excursion; //dB
571  m_objCfg.rrc_steps = 0; //auto
572 
573  switch(m_settings.m_modulation)
574  {
577  break;
580  break;
583  break;
586  break;
589  break;
592  break;
595  break;
598  break;
601  break;
602  default:
604  break;
605  }
606 
612 
613  // Min buffer size for baseband data
614  // scopes: 1024
615  // ss_estimator: 1024
616  // anf: 4096
617  // cstln_receiver: reads in chunks of 128+1
619 
620  // Min buffer size for IQ symbols
621  // cstln_receiver: writes in chunks of 128/omega symbols (margin 128)
622  // deconv_sync: reads at least 64+32
623  // A larger buffer improves performance significantly.
625 
626  // Min buffer size for unsynchronized bytes
627  // deconv_sync: writes 32 bytes
628  // mpeg_sync: reads up to 204*scan_syncs = 1632 bytes
629  BUF_BYTES = 2048 * m_objCfg.buf_factor;
630 
631  // Min buffer size for synchronized (but interleaved) bytes
632  // mpeg_sync: writes 1 rspacket
633  // deinterleaver: reads 17*11*12+204 = 2448 bytes
635 
636  // Min buffer size for packets: 1
638 
639  // Min buffer size for misc measurements: 1
641 
643 
645 
646  //***************
650 
651  // NOTCH FILTER
652 
653  if (m_objCfg.anf>0)
654  {
657  p_preprocessed = p_autonotched;
658  }
659 
660 
661  // FREQUENCY CORRECTION
662 
663  //******** -> if ( m_objCfg.Fderot>0 )
664 
665  // CNR ESTIMATION
666 
668 
669  if (m_objCfg.cnr == true)
670  {
672  r_cnr->decimation = decimation(m_objCfg.Fs, 1); // 1 Hz
673  }
674 
675  // FILTERING
676 
677  int decim = 1;
678 
679  //******** -> if ( m_objCfg.resample )
680 
681 
682  // DECIMATION
683  // (Unless already done in resampler)
684 
685  //******** -> if ( !m_objCfg.resample && m_objCfg.decim>1 )
686 
687  //Resampling FS
688 
689 
690  // Generic constellation receiver
691 
697 
698  switch (m_objCfg.sampler)
699  {
702  break;
705  break;
707  {
708  if (m_objCfg.rrc_steps == 0)
709  {
710  // At least 64 discrete sampling points between symbols
711  m_objCfg.rrc_steps = std::max(1, (int)(64*m_objCfg.Fm / m_objCfg.Fs));
712  }
713 
714  float Frrc = m_objCfg.Fs * m_objCfg.rrc_steps; // Sample freq of the RRC filter
715  float transition = (m_objCfg.Fm/2) * m_objCfg.rolloff;
716  int order = m_objCfg.rrc_rej * Frrc / (22*transition);
719  break;
720  }
721  default:
722  qCritical("DATVDemod::InitDATVFramework: Interpolator not implemented");
723  return;
724  }
725 
728  sampler,
730  *p_symbols,
731  p_freq,
732  p_ss,
733  p_mer,
734  p_sampled);
735 
737  {
740  {
741  qWarning("DATVDemod::InitDATVFramework: non-standard constellation for DVB-S");
742  }
743  }
744 
746  {
747  // For DVB-S2 testing only.
748  // Constellation should be determined from PL signalling.
749  qDebug("DATVDemod::InitDATVFramework: DVB-S2: Testing symbol sampler only.");
750  }
751 
752  m_objDemodulator->cstln = make_dvbs_constellation(m_objCfg.constellation, m_objCfg.fec);
753 
754  if (m_objCfg.hard_metric) {
756  }
757 
759 
760  //******** if ( m_objCfg.Ftune )
761  //{
762  // m_objDemodulator->set_freq(m_objCfg.Ftune/m_objCfg.Fs);
763  //}
764 
765  if (m_objCfg.allow_drift) {
767  }
768 
769  //******** -> if ( m_objCfg.viterbi )
770  if (m_objCfg.viterbi) {
772  }
773 
775 
776  // TRACKING FILTERS
777 
778  if (r_cnr)
779  {
781  r_cnr->tap_multiplier = 1.0 / decim;
782  }
783 
784  //constellation
785 
787  {
788  qDebug("DATVDemod::InitDATVFramework: Register DVBSTVSCREEN");
789 
795  }
796 
797  // DECONVOLUTION AND SYNCHRONIZATION
798 
800 
801  r_deconv = nullptr;
802 
803  //******** -> if ( m_objCfg.viterbi )
804 
805  if (m_objCfg.viterbi)
806  {
809  }
810 
811  //To uncomment -> Linking Problem : undefined symbol: _ZN7leansdr21viterbi_dec_interfaceIhhiiE6updateEPiS2_
812  r = new leansdr::viterbi_sync(m_objScheduler, (*p_symbols), (*p_bytes), m_objDemodulator->cstln, m_objCfg.fec);
813 
814  if (m_objCfg.fastlock) {
815  r->resync_period = 1;
816  }
817  }
818  else
819  {
820  r_deconv = make_deconvol_sync_simple(m_objScheduler, (*p_symbols), (*p_bytes), m_objCfg.fec);
821  r_deconv->fastlock = m_objCfg.fastlock;
822  }
823 
824  //******* -> if ( m_objCfg.hdlc )
825 
829 
831  r_sync_mpeg->fastlock = m_objCfg.fastlock;
832 
833  // DEINTERLEAVING
834 
837 
838  // REED-SOLOMON
839 
844 
845  // BER ESTIMATION
846 
847  /*
848  p_vber = new pipebuf<float> (m_objScheduler, "VBER", BUF_SLOW);
849  r_vber = new rate_estimator<float> (m_objScheduler, *p_verrcount, *p_vbitcount, *p_vber);
850  r_vber->sample_size = m_objCfg.Fm/2; // About twice per second, depending on CR
851  // Require resolution better than 2E-5
852  if ( r_vber->sample_size < 50000 )
853  {
854  r_vber->sample_size = 50000;
855  }
856  */
857 
858  // DERANDOMIZATION
860  r_derand = new leansdr::derandomizer(m_objScheduler, *p_rtspackets, *p_tspackets);
861 
862  // OUTPUT
864 
865  m_blnDVBInitialized = true;
866 }
leansdr::pipebuf< leansdr::u8 > * p_bytes
Definition: datvdemod.h:357
leansdr::pipebuf< leansdr::f32 > * p_ss
Definition: datvdemod.h:330
leansdr::code_rate fec
Definition: datvdemod.h:81
int buf_factor
Definition: datvdemod.h:73
leansdr::pipebuf< int > * p_lock
Definition: datvdemod.h:367
leansdr::rs_decoder< leansdr::u8, 0 > * r_rsdec
Definition: datvdemod.h:380
leansdr::pipebuf< leansdr::u32 > * p_locktime
Definition: datvdemod.h:368
cstln_lut< eucl_ss, 256 > ** cstln
leansdr::pipebuf< leansdr::u8 > * p_mpegbytes
Definition: datvdemod.h:366
bool viterbi
Definition: datvdemod.h:85
leansdr::pipebuf< leansdr::tspacket > * p_rtspackets
Definition: datvdemod.h:379
cstln_lut< SOFTSYMB, 256 > * cstln
Definition: sdr.h:1040
leansdr::pipebuf< int > * p_vbitcount
Definition: datvdemod.h:377
leansdr::pipebuf< leansdr::rspacket< leansdr::u8 > > * p_rspackets
Definition: datvdemod.h:373
unsigned long BUF_PACKETS
Definition: datvdemod.h:280
deconvol_sync_simple * make_deconvol_sync_simple(scheduler *sch, pipebuf< eucl_ss > &_in, pipebuf< u8 > &_out, enum code_rate rate)
Definition: dvb.cpp:6
leansdr::pipebuf< leansdr::f32 > * p_cnr
Definition: datvdemod.h:314
leansdr::pipewriter< leansdr::cf32 > * p_rawiq_writer
Definition: datvdemod.h:302
int decimation(float Fin, float Fout)
Definition: datvdemod.h:66
unsigned long BUF_MPEGBYTES
Definition: datvdemod.h:279
DATVModulation m_modulation
leansdr::pipebuf< leansdr::f32 > * p_freq
Definition: datvdemod.h:329
leansdr::pipebuf< leansdr::eucl_ss > * p_symbols
Definition: datvdemod.h:328
leansdr::datvvideoplayer< leansdr::tspacket > * r_videoplayer
Definition: datvdemod.h:393
bool allow_drift
Definition: datvdemod.h:83
int ncoeffs_sampler
Definition: datvdemod.h:326
unsigned long BUF_SLOW
Definition: datvdemod.h:281
float rrc_rej
Definition: datvdemod.h:90
leansdr::pipebuf< leansdr::cf32 > * p_autonotched
Definition: datvdemod.h:307
leansdr::cnr_fft< leansdr::f32 > * r_cnr
Definition: datvdemod.h:315
leansdr::mpeg_sync< leansdr::u8, 0 > * r_sync_mpeg
Definition: datvdemod.h:369
DATVDemodSettings::dvb_sampler sampler
Definition: datvdemod.h:71
bool m_blnDVBInitialized
Definition: datvdemod.h:295
unsigned long meas_decimation
Definition: sdr.h:1041
bool cnr
Definition: datvdemod.h:77
leansdr::viterbi_sync * r
Definition: datvdemod.h:359
leansdr::deinterleaver< leansdr::u8 > * r_deinter
Definition: datvdemod.h:374
int rrc_steps
Definition: datvdemod.h:89
void resizeTVScreen(int intCols, int intRows)
Definition: tvscreen.cpp:86
leansdr::auto_notch< leansdr::f32 > * r_auto_notch
Definition: datvdemod.h:306
code_rate
Definition: dvb.h:41
leansdr::pipebuf< leansdr::cf32 > * p_rawiq
Definition: datvdemod.h:301
leansdr::deconvol_sync_simple * r_deconv
Definition: datvdemod.h:358
unsigned long BUF_SYMBOLS
Definition: datvdemod.h:277
float rolloff
Definition: datvdemod.h:91
void set_allow_drift(bool d)
Definition: sdr.h:1097
DATVUDPStream m_udpStream
Definition: datvdemod.h:408
long m_lngReadIQ
Definition: datvdemod.h:272
leansdr::datvconstellation< leansdr::f32 > * r_scope_symbols
Definition: datvdemod.h:396
unsigned long BUF_BASEBAND
Definition: datvdemod.h:276
unsigned long m_lngExpectedReadIQ
Definition: datvdemod.h:271
unsigned long BUF_BYTES
Definition: datvdemod.h:278
leansdr::pipebuf< int > * p_verrcount
Definition: datvdemod.h:378
leansdr::scheduler * m_objScheduler
Definition: datvdemod.h:292
DATVideostream * m_objVideoStream
Definition: datvdemod.h:407
void set_omega(float _omega, float tol=10e-6)
Definition: sdr.h:1082
leansdr::cstln_lut< leansdr::eucl_ss, 256 >::predef constellation
Definition: datvdemod.h:80
static int getLeanDVBCodeRateFromDATV(DATVDemodSettings::DATVCodeRate datvCodeRate)
Definition: datvdemod.cpp:1532
struct config m_objCfg
Definition: datvdemod.h:293
float * freq_tap
Definition: sdr.h:1730
DATVDemodSettings::dvb_version standard
Definition: datvdemod.h:70
leansdr::pipebuf< leansdr::cf32 > * p_preprocessed
Definition: datvdemod.h:303
leansdr::pipebuf< leansdr::tspacket > * p_tspackets
Definition: datvdemod.h:387
bool hard_metric
Definition: datvdemod.h:86
void CleanUpDATVFramework(bool blnRelease)
Definition: datvdemod.cpp:205
float Finfo
Definition: datvdemod.h:94
int root_raised_cosine(int order, float Fs, float rolloff, T **coeffs)
Definition: filtergen.h:91
float Fm
Definition: datvdemod.h:79
leansdr::sampler_interface< leansdr::f32 > * sampler
Definition: datvdemod.h:324
int anf
Definition: datvdemod.h:76
int m_sampleRate
Definition: datvdemod.h:428
DATVDemodSettings m_settings
Definition: datvdemod.h:427
leansdr::derandomizer * r_derand
Definition: datvdemod.h:388
bool fastlock
Definition: datvdemod.h:84
TVScreen * m_objRegisteredTVScreen
Definition: datvdemod.h:405
leansdr::pipebuf< leansdr::f32 > * p_mer
Definition: datvdemod.h:331
void harden()
Definition: sdr.h:870
dvb_version m_standard
leansdr::cstln_receiver< leansdr::f32, leansdr::eucl_ss > * m_objDemodulator
Definition: datvdemod.h:354
leansdr::pipebuf< leansdr::cf32 > * p_sampled
Definition: datvdemod.h:332
float * coeffs_sampler
Definition: datvdemod.h:325
T max(const T &x, const T &y)
Definition: framework.h:446
float Fs
Definition: datvdemod.h:74
float tap_multiplier
Definition: sdr.h:1730
int decimation
Definition: sdr.h:1731
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InitDATVParameters()

void DATVDemod::InitDATVParameters ( int  intMsps,
int  intRFBandwidth,
int  intCenterFrequency,
DATVDemodSettings::dvb_version  enmStandard,
DATVDemodSettings::DATVModulation  enmModulation,
leansdr::code_rate  enmFEC,
int  intSampleRate,
int  intSymbolRate,
int  intNotchFilters,
bool  blnAllowDrift,
bool  blnFastLock,
DATVDemodSettings::dvb_sampler  enmFilter,
bool  blnHardMetric,
float  fltRollOff,
bool  blnViterbi,
int  intEExcursion 
)

◆ InitDATVS2Framework()

void DATVDemod::InitDATVS2Framework ( )

p_cnr = new leansdr::pipebuf<leansdr::f32>(m_objScheduler, "cnr", BUF_SLOW);

if (m_objCfg.cnr == true) { r_cnr = new leansdr::cnr_fft<leansdr::f32>(m_objScheduler, *p_preprocessed, *p_cnr, m_objCfg.Fm/m_objCfg.Fs); r_cnr->decimation = decimation(m_objCfg.Fs, 1); // 1 Hz }

Definition at line 869 of file datvdemod.cpp.

References config::allow_drift, config::anf, DATVDemodSettings::APSK16, DATVDemodSettings::APSK32, DATVDemodSettings::APSK64E, DATVDemodSettings::BPSK, BUF_BASEBAND, config::buf_factor, BUF_FRAMES, BUF_S2PACKETS, BUF_SLOTS, BUF_SLOW, BUF_SYMBOLS, CleanUpDATVFramework(), coeffs_sampler, config::constellation, leansdr::s2_frame_receiver< T, SOFTSYMB >::cstln, decimation(), config::fastlock, config::fec, config::Finfo, config::Fm, leansdr::s2_frame_receiver< T, SOFTSYMB >::Fm, config::Fs, config::Ftune, leansdr::s2_frame_receiver< T, SOFTSYMB >::Ftune, getLeanDVBCodeRateFromDATV(), config::hard_metric, DATVDemodSettings::m_allowDrift, m_blnDVBInitialized, DATVDemodSettings::m_excursion, DATVDemodSettings::m_fastLock, DATVDemodSettings::m_fec, DATVDemodSettings::m_filter, DATVDemodSettings::m_hardMetric, m_lngExpectedReadIQ, m_lngReadIQ, DATVDemodSettings::m_modulation, DATVDemodSettings::m_notchFilters, m_objCfg, m_objDemodulatorDVBS2, m_objScheduler, DATVDemodSettings::m_rollOff, m_sampleRate, m_settings, DATVDemodSettings::m_standard, DATVDemodSettings::m_symbolRate, DATVDemodSettings::m_viterbi, leansdr::max(), leansdr::modcod_info::MAX_SLOTS_PER_FRAME, leansdr::s2_frame_receiver< T, SOFTSYMB >::meas_decimation, ncoeffs_sampler, leansdr::s2_frame_receiver< T, SOFTSYMB >::omega, p_autonotched, p_cstln, p_cstln_pls, p_framelock, p_freq, p_mer, p_preprocessed, p_rawiq, p_rawiq_writer, p_slots_dvbs2, p_ss, DATVDemodSettings::PSK8, DATVDemodSettings::QAM16, DATVDemodSettings::QAM256, DATVDemodSettings::QAM64, DATVDemodSettings::QPSK, r_auto_notch, config::rolloff, leansdr::filtergen::root_raised_cosine(), config::rrc_rej, config::rrc_steps, S2_MAX_SYMBOLS, DATVDemodSettings::SAMP_LINEAR, DATVDemodSettings::SAMP_NEAREST, DATVDemodSettings::SAMP_RRC, config::sampler, sampler, config::standard, leansdr::s2_frame_receiver< T, SOFTSYMB >::strongpls, and config::viterbi.

Referenced by feed().

870 {
872 
873  m_blnDVBInitialized = false;
874  m_lngReadIQ = 0;
875  CleanUpDATVFramework(false);
876 
877  qDebug() << "DATVDemod::InitDATVS2Framework:"
878  << " Standard: " << m_settings.m_standard
879  << " Symbol Rate: " << m_settings.m_symbolRate
880  << " Modulation: " << m_settings.m_modulation
881  << " Notch Filters: " << m_settings.m_notchFilters
882  << " Allow Drift: " << m_settings.m_allowDrift
883  << " Fast Lock: " << m_settings.m_fastLock
884  << " Filter: " << m_settings.m_filter
885  << " HARD METRIC: " << m_settings.m_hardMetric
886  << " RollOff: " << m_settings.m_rollOff
887  << " Viterbi: " << m_settings.m_viterbi
888  << " Excursion: " << m_settings.m_excursion
889  << " Sample rate: " << m_sampleRate ;
890 
891 
892 
894 
896  m_objCfg.Fs = (float) m_sampleRate;
899 
902  m_objCfg.rrc_rej = (float) m_settings.m_excursion; //dB
903  m_objCfg.rrc_steps = 0; //auto
904 
905  switch(m_settings.m_modulation)
906  {
909  break;
912  break;
915  break;
918  break;
921  break;
924  break;
927  break;
930  break;
933  break;
934  default:
936  break;
937  }
938 
944 
945  // Min buffer size for baseband data
946  S2_MAX_SYMBOLS = (90*(1+360)+36*((360-1)/16));
947 
949  // Min buffer size for IQ symbols
950  // cstln_receiver: writes in chunks of 128/omega symbols (margin 128)
951  // deconv_sync: reads at least 64+32
952  // A larger buffer improves performance significantly.
954 
955 
956  // Min buffer size for misc measurements: 1
958 
959  // dvbs2 : Min buffer size for slots: 4 for deinterleaver
961 
963 
964  // Min buffer size for TS packets: Up to 39 per BBFRAME
965  BUF_S2PACKETS = (leansdr::fec_info::KBCH_MAX/188/8+1) * m_objCfg.buf_factor;
966 
968 
970 
971  //***************
975 
976  // NOTCH FILTER
977 
978  if (m_objCfg.anf>0)
979  {
982  p_preprocessed = p_autonotched;
983  }
984 
985  // FREQUENCY CORRECTION
986 
987  //******** -> if ( m_objCfg.Fderot>0 )
988 
989  // CNR ESTIMATION
999  // FILTERING
1000 
1001  int decim = 1;
1002 
1003  //******** -> if ( m_objCfg.resample )
1004 
1005 
1006  // DECIMATION
1007  // (Unless already done in resampler)
1008 
1009  //******** -> if ( !m_objCfg.resample && m_objCfg.decim>1 )
1010 
1011  //Resampling FS
1012 
1013 
1014  // Generic constellation receiver
1015 
1019 
1020  switch (m_objCfg.sampler)
1021  {
1024  break;
1027  break;
1029  {
1030  if (m_objCfg.rrc_steps == 0)
1031  {
1032  // At least 64 discrete sampling points between symbols
1033  m_objCfg.rrc_steps = std::max(1, (int)(64*m_objCfg.Fm / m_objCfg.Fs));
1034  }
1035 
1036  float Frrc = m_objCfg.Fs * m_objCfg.rrc_steps; // Sample freq of the RRC filter
1037  float transition = (m_objCfg.Fm/2) * m_objCfg.rolloff;
1038  int order = m_objCfg.rrc_rej * Frrc / (22*transition);
1041  break;
1042  }
1043  default:
1044  qCritical("DATVDemod::InitDATVS2Framework: Interpolator not implemented");
1045  return;
1046  }
1047 
1049 
1053 
1056  sampler,
1057  *p_preprocessed,
1059  /* p_freq */ nullptr,
1060  /* p_ss */ nullptr,
1061  /* p_mer */ nullptr,
1062  p_cstln,
1063  /* p_cstln_pls */ nullptr,
1064  /*p_iqsymbols*/ nullptr,
1065  /* p_framelock */nullptr);
1066 
1068 
1069 
1070  objDemodulatorDVBS2->omega = m_objCfg.Fs/m_objCfg.Fm;
1071 //objDemodulatorDVBS2->mu=1;
1072 
1073 
1074  m_objCfg.Ftune=0.0f;
1075  objDemodulatorDVBS2->Ftune = m_objCfg.Ftune / m_objCfg.Fm;
1076 
1077 /*
1078  demod.strongpls = cfg.strongpls;
1079 */
1080 
1081  objDemodulatorDVBS2->Fm = m_objCfg.Fm;
1082  objDemodulatorDVBS2->meas_decimation = decimation(m_objCfg.Fs, m_objCfg.Finfo);
1083 
1084  objDemodulatorDVBS2->strongpls = false;
1085 
1086 
1087  objDemodulatorDVBS2->cstln = make_dvbs2_constellation(m_objCfg.constellation, m_objCfg.fec);
1088  m_cstlnSetByModcod = false;
1089 
1090  //constellation
1091 
1093  {
1094  qDebug("DATVDemod::InitDATVS2Framework: Register DVBS 2 TVSCREEN");
1095 
1097  r_scope_symbols_dvbs2 = new leansdr::datvdvbs2constellation<leansdr::f32>(m_objScheduler, *p_cstln /* *p_sampled */ /* *p_cstln */, -128,128, nullptr, m_objRegisteredTVScreen);
1099  r_scope_symbols_dvbs2->cstln = (leansdr::cstln_base**) &objDemodulatorDVBS2->cstln;
1101  }
1102 
1103  // Bit-flipping mode.
1104  // Deinterleave into hard bits.
1105 
1107 
1109 
1114  );
1115 
1118 
1122  p_vbitcount,
1123  p_verrcount
1124  );
1126 
1127  fecdec->bitflips=0;
1128 
1129  /*
1130  fecdec->bitflips = cfg.ldpc_bf; //int TODO
1131  if ( ! cfg.ldpc_bf )
1132  fprintf(stderr, "Warning: No LDPC error correction selected.\n")
1133  */
1134 
1135  // Deframe BB frames to TS packets
1139 
1140  p_deframer = new leansdr::s2_deframer(m_objScheduler,*(leansdr::pipebuf<leansdr::bbframe> *) p_bbframes, *p_tspackets, p_lock, p_locktime);
1141 
1142 /*
1143  if ( cfg.fd_gse >= 0 ) deframer.fd_gse = cfg.fd_gse;
1144 */
1145  //**********************************************
1146 
1147  // OUTPUT
1149 
1150  m_blnDVBInitialized = true;
1151 }
leansdr::pipebuf< leansdr::f32 > * p_ss
Definition: datvdemod.h:330
leansdr::code_rate fec
Definition: datvdemod.h:81
int buf_factor
Definition: datvdemod.h:73
leansdr::pipebuf< int > * p_lock
Definition: datvdemod.h:367
void * p_deframer
Definition: datvdemod.h:344
leansdr::pipebuf< leansdr::u32 > * p_locktime
Definition: datvdemod.h:368
void * p_fecframes
Definition: datvdemod.h:340
bool viterbi
Definition: datvdemod.h:85
bool m_cstlnSetByModcod
Definition: datvdemod.h:420
leansdr::pipebuf< int > * p_vbitcount
Definition: datvdemod.h:377
void * m_objDemodulatorDVBS2
Definition: datvdemod.h:339
leansdr::datvdvbs2constellation< leansdr::f32 > * r_scope_symbols_dvbs2
Definition: datvdemod.h:397
leansdr::pipewriter< leansdr::cf32 > * p_rawiq_writer
Definition: datvdemod.h:302
int decimation(float Fin, float Fout)
Definition: datvdemod.h:66
DATVModulation m_modulation
leansdr::pipebuf< leansdr::f32 > * p_freq
Definition: datvdemod.h:329
leansdr::datvvideoplayer< leansdr::tspacket > * r_videoplayer
Definition: datvdemod.h:393
bool allow_drift
Definition: datvdemod.h:83
int ncoeffs_sampler
Definition: datvdemod.h:326
unsigned long BUF_SLOW
Definition: datvdemod.h:281
unsigned long BUF_FRAMES
Definition: datvdemod.h:286
float Ftune
Definition: datvdemod.h:82
float rrc_rej
Definition: datvdemod.h:90
static const int MAX_SLOTS_PER_FRAME
Definition: dvbs2.h:222
leansdr::pipebuf< leansdr::cf32 > * p_autonotched
Definition: datvdemod.h:307
DATVDemodSettings::dvb_sampler sampler
Definition: datvdemod.h:71
bool m_blnDVBInitialized
Definition: datvdemod.h:295
int rrc_steps
Definition: datvdemod.h:89
void resizeTVScreen(int intCols, int intRows)
Definition: tvscreen.cpp:86
leansdr::pipebuf< int > * p_framelock
Definition: datvdemod.h:338
leansdr::auto_notch< leansdr::f32 > * r_auto_notch
Definition: datvdemod.h:306
code_rate
Definition: dvb.h:41
leansdr::pipebuf< leansdr::cf32 > * p_rawiq
Definition: datvdemod.h:301
unsigned long BUF_SYMBOLS
Definition: datvdemod.h:277
float rolloff
Definition: datvdemod.h:91
cstln_lut< SOFTSYMB, 256 > * cstln
Definition: dvbs2.h:1153
unsigned long S2_MAX_SYMBOLS
Definition: datvdemod.h:288
DATVUDPStream m_udpStream
Definition: datvdemod.h:408
long m_lngReadIQ
Definition: datvdemod.h:272
leansdr::pipebuf< leansdr::cf32 > * p_cstln
Definition: datvdemod.h:336
void * p_s2_deinterleaver
Definition: datvdemod.h:342
unsigned long BUF_BASEBAND
Definition: datvdemod.h:276
unsigned long m_lngExpectedReadIQ
Definition: datvdemod.h:271
void * r_fecdec
Definition: datvdemod.h:343
leansdr::pipebuf< int > * p_verrcount
Definition: datvdemod.h:378
leansdr::scheduler * m_objScheduler
Definition: datvdemod.h:292
DATVideostream * m_objVideoStream
Definition: datvdemod.h:407
leansdr::cstln_lut< leansdr::eucl_ss, 256 >::predef constellation
Definition: datvdemod.h:80
void * p_slots_dvbs2
Definition: datvdemod.h:335
unsigned long BUF_SLOTS
Definition: datvdemod.h:285
static int getLeanDVBCodeRateFromDATV(DATVDemodSettings::DATVCodeRate datvCodeRate)
Definition: datvdemod.cpp:1532
struct config m_objCfg
Definition: datvdemod.h:293
DATVDemodSettings::dvb_version standard
Definition: datvdemod.h:70
leansdr::pipebuf< leansdr::cf32 > * p_preprocessed
Definition: datvdemod.h:303
leansdr::pipebuf< leansdr::tspacket > * p_tspackets
Definition: datvdemod.h:387
bool hard_metric
Definition: datvdemod.h:86
leansdr::pipebuf< leansdr::cf32 > * p_cstln_pls
Definition: datvdemod.h:337
unsigned long BUF_S2PACKETS
Definition: datvdemod.h:287
void CleanUpDATVFramework(bool blnRelease)
Definition: datvdemod.cpp:205
float Finfo
Definition: datvdemod.h:94
int root_raised_cosine(int order, float Fs, float rolloff, T **coeffs)
Definition: filtergen.h:91
float Fm
Definition: datvdemod.h:79
leansdr::sampler_interface< leansdr::f32 > * sampler
Definition: datvdemod.h:324
int anf
Definition: datvdemod.h:76
int m_sampleRate
Definition: datvdemod.h:428
DATVDemodSettings m_settings
Definition: datvdemod.h:427
bool fastlock
Definition: datvdemod.h:84
TVScreen * m_objRegisteredTVScreen
Definition: datvdemod.h:405
leansdr::pipebuf< leansdr::f32 > * p_mer
Definition: datvdemod.h:331
dvb_version m_standard
float * coeffs_sampler
Definition: datvdemod.h:325
T max(const T &x, const T &y)
Definition: framework.h:446
void * p_bbframes
Definition: datvdemod.h:341
float Fs
Definition: datvdemod.h:74
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCstlnSetByModcod()

bool DATVDemod::isCstlnSetByModcod ( ) const
inline

Definition at line 191 of file datvdemod.h.

Referenced by DATVDemodGUI::tick().

191 { return m_cstlnSetByModcod; }
bool m_cstlnSetByModcod
Definition: datvdemod.h:420
+ Here is the caller graph for this function:

◆ PlayVideo()

bool DATVDemod::PlayVideo ( bool  blnStartStop)

Definition at line 162 of file datvdemod.cpp.

References DATVideostream::bytesAvailable(), m_blnStartStopVideo, m_objRegisteredVideoRender, m_objRenderThread, m_objVideoStream, DATVideostream::MultiThreaded, DATVideoRenderThread::setStreamAndRenderer(), DATVideoRenderThread::stopRendering(), and DATVideostream::ThreadTimeOut.

Referenced by DATVDemodGUI::tick().

163 {
164 
165  if (m_objVideoStream == nullptr) {
166  return false;
167  }
168 
169  if (m_objRegisteredVideoRender == nullptr) {
170  return false;
171  }
172 
173  if (m_objRenderThread == nullptr) {
174  return false;
175  }
176 
177  if (m_blnStartStopVideo && !blnStartStop) {
178  return true;
179  }
180 
181  if (blnStartStop == true) {
182  m_blnStartStopVideo = true;
183  }
184 
185  if (m_objRenderThread->isRunning())
186  {
187  if (blnStartStop == true) {
189  }
190 
191  return true;
192  }
193 
194  if (m_objVideoStream->bytesAvailable() > 0)
195  {
198  m_objVideoStream->ThreadTimeOut = 5000; //5000 ms
199  m_objRenderThread->start();
200  }
201 
202  return true;
203 }
DATVideoRender * m_objRegisteredVideoRender
Definition: datvdemod.h:406
DATVideostream * m_objVideoStream
Definition: datvdemod.h:407
bool m_blnStartStopVideo
Definition: datvdemod.h:419
DATVideoRenderThread * m_objRenderThread
Definition: datvdemod.h:409
virtual qint64 bytesAvailable() const
void setStreamAndRenderer(DATVideoRender *renderer, DATVideostream *stream)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

virtual QByteArray DATVDemod::serialize ( ) const
inlinevirtual

Implements ChannelAPI.

Definition at line 139 of file datvdemod.h.

139 { return QByteArray(); }

◆ SetTVScreen()

bool DATVDemod::SetTVScreen ( TVScreen objScreen)

Definition at line 112 of file datvdemod.cpp.

References m_objRegisteredTVScreen.

Referenced by DATVDemodGUI::DATVDemodGUI().

113 {
114  m_objRegisteredTVScreen = objScreen;
115  return true;
116 }
TVScreen * m_objRegisteredTVScreen
Definition: datvdemod.h:405
+ Here is the caller graph for this function:

◆ SetVideoRender()

DATVideostream * DATVDemod::SetVideoRender ( DATVideoRender objScreen)

Definition at line 118 of file datvdemod.cpp.

References m_audioFifo, m_objRegisteredVideoRender, m_objRenderThread, m_objVideoStream, and DATVideoRender::setAudioFIFO().

Referenced by DATVDemodGUI::DATVDemodGUI().

119 {
120  m_objRegisteredVideoRender = objScreen;
123  return m_objVideoStream;
124 }
DATVideoRender * m_objRegisteredVideoRender
Definition: datvdemod.h:406
DATVideostream * m_objVideoStream
Definition: datvdemod.h:407
DATVideoRenderThread * m_objRenderThread
Definition: datvdemod.h:409
void setAudioFIFO(AudioFifo *fifo)
AudioFifo m_audioFifo
Definition: datvdemod.h:412
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start()

void DATVDemod::start ( )
virtual

Implements BasebandSampleSink.

Definition at line 1294 of file datvdemod.cpp.

References AudioFifo::clear(), and m_audioFifo.

1295 {
1296  m_audioFifo.clear();
1297 }
void clear()
Definition: audiofifo.cpp:156
AudioFifo m_audioFifo
Definition: datvdemod.h:412
+ Here is the call graph for this function:

◆ stop()

void DATVDemod::stop ( )
virtual

Implements BasebandSampleSink.

Definition at line 1299 of file datvdemod.cpp.

1300 {
1301 }

◆ videoActive()

bool DATVDemod::videoActive ( )

Definition at line 135 of file datvdemod.cpp.

References DATVideoRender::getVideoStreamIndex(), and m_objRegisteredVideoRender.

Referenced by DATVDemodGUI::tick().

136 {
139  } else {
140  return false;
141  }
142 }
int getVideoStreamIndex() const
DATVideoRender * m_objRegisteredVideoRender
Definition: datvdemod.h:406
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ videoDecodeOK()

bool DATVDemod::videoDecodeOK ( )

Definition at line 153 of file datvdemod.cpp.

References DATVideoRender::getVideoDecodeOK(), and m_objRegisteredVideoRender.

Referenced by DATVDemodGUI::tick().

154 {
157  } else {
158  return false;
159  }
160 }
DATVideoRender * m_objRegisteredVideoRender
Definition: datvdemod.h:406
bool getVideoDecodeOK() const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ BUF_BASEBAND

unsigned long DATVDemod::BUF_BASEBAND
private

Definition at line 276 of file datvdemod.h.

Referenced by InitDATVFramework(), and InitDATVS2Framework().

◆ BUF_BYTES

unsigned long DATVDemod::BUF_BYTES
private

Definition at line 278 of file datvdemod.h.

Referenced by InitDATVFramework().

◆ BUF_FRAMES

unsigned long DATVDemod::BUF_FRAMES
private

Definition at line 286 of file datvdemod.h.

Referenced by InitDATVS2Framework().

◆ BUF_MPEGBYTES

unsigned long DATVDemod::BUF_MPEGBYTES
private

Definition at line 279 of file datvdemod.h.

Referenced by InitDATVFramework().

◆ BUF_PACKETS

unsigned long DATVDemod::BUF_PACKETS
private

Definition at line 280 of file datvdemod.h.

Referenced by InitDATVFramework().

◆ BUF_S2PACKETS

unsigned long DATVDemod::BUF_S2PACKETS
private

Definition at line 287 of file datvdemod.h.

Referenced by InitDATVS2Framework().

◆ BUF_SLOTS

unsigned long DATVDemod::BUF_SLOTS
private

Definition at line 285 of file datvdemod.h.

Referenced by InitDATVS2Framework().

◆ BUF_SLOW

unsigned long DATVDemod::BUF_SLOW
private

Definition at line 281 of file datvdemod.h.

Referenced by InitDATVFramework(), and InitDATVS2Framework().

◆ BUF_SYMBOLS

unsigned long DATVDemod::BUF_SYMBOLS
private

Definition at line 277 of file datvdemod.h.

Referenced by InitDATVFramework(), and InitDATVS2Framework().

◆ coeffs

float* DATVDemod::coeffs
private

Definition at line 320 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ coeffs_sampler

float* DATVDemod::coeffs_sampler
private

Definition at line 325 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), InitDATVFramework(), and InitDATVS2Framework().

◆ m_audioFifo

AudioFifo DATVDemod::m_audioFifo
private

Definition at line 412 of file datvdemod.h.

Referenced by applySettings(), SetVideoRender(), start(), and ~DATVDemod().

◆ m_blnDVBInitialized

bool DATVDemod::m_blnDVBInitialized
private

Definition at line 295 of file datvdemod.h.

Referenced by feed(), InitDATVFramework(), and InitDATVS2Framework().

◆ m_blnInitialized

bool DATVDemod::m_blnInitialized
private

Definition at line 417 of file datvdemod.h.

Referenced by ~DATVDemod().

◆ m_blnNeedConfigUpdate

bool DATVDemod::m_blnNeedConfigUpdate
private

Definition at line 296 of file datvdemod.h.

Referenced by applySettings(), and feed().

◆ m_blnRenderingVideo

bool DATVDemod::m_blnRenderingVideo
private

Definition at line 418 of file datvdemod.h.

◆ m_blnStartStopVideo

bool DATVDemod::m_blnStartStopVideo
private

Definition at line 419 of file datvdemod.h.

Referenced by PlayVideo().

◆ m_channelId

const QString DATVDemod::m_channelId = "DATVDemod"
static

Definition at line 198 of file datvdemod.h.

Referenced by DATVDemodPlugin::initPlugin().

◆ m_channelIdURI

const QString DATVDemod::m_channelIdURI = "sdrangel.channel.demoddatv"
static

Definition at line 197 of file datvdemod.h.

Referenced by DATVDemodGUI::DATVDemodGUI(), and DATVDemodPlugin::initPlugin().

◆ m_channelizer

DownChannelizer* DATVDemod::m_channelizer
private

Definition at line 402 of file datvdemod.h.

Referenced by handleMessage(), and ~DATVDemod().

◆ m_cstlnSetByModcod

bool DATVDemod::m_cstlnSetByModcod
private

Definition at line 420 of file datvdemod.h.

Referenced by feed().

◆ m_deviceAPI

DeviceAPI* DATVDemod::m_deviceAPI
private

Definition at line 399 of file datvdemod.h.

Referenced by ~DATVDemod().

◆ m_enmModulation

DATVDemodSettings::DATVModulation DATVDemod::m_enmModulation
private

Definition at line 424 of file datvdemod.h.

◆ m_inputFrequencyOffset

int DATVDemod::m_inputFrequencyOffset
private

Definition at line 429 of file datvdemod.h.

Referenced by handleMessage().

◆ m_lngExpectedReadIQ

unsigned long DATVDemod::m_lngExpectedReadIQ
private

Definition at line 271 of file datvdemod.h.

Referenced by InitDATVFramework(), and InitDATVS2Framework().

◆ m_lngReadIQ

long DATVDemod::m_lngReadIQ
private

Definition at line 272 of file datvdemod.h.

Referenced by feed(), InitDATVFramework(), and InitDATVS2Framework().

◆ m_modcodCodeRate

int DATVDemod::m_modcodCodeRate
private

Definition at line 422 of file datvdemod.h.

Referenced by feed().

◆ m_modcodModulation

int DATVDemod::m_modcodModulation
private

Definition at line 421 of file datvdemod.h.

Referenced by feed().

◆ m_objCfg

struct config DATVDemod::m_objCfg
private

Definition at line 293 of file datvdemod.h.

Referenced by InitDATVFramework(), and InitDATVS2Framework().

◆ m_objDemodulator

leansdr::cstln_receiver<leansdr::f32, leansdr::eucl_ss>* DATVDemod::m_objDemodulator
private

Definition at line 354 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), and InitDATVFramework().

◆ m_objDemodulatorDVBS2

void* DATVDemod::m_objDemodulatorDVBS2
private

Definition at line 339 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), feed(), and InitDATVS2Framework().

◆ m_objMagSqAverage

MovingAverageUtil<double, double, 32> DATVDemod::m_objMagSqAverage
private

Definition at line 430 of file datvdemod.h.

Referenced by feed().

◆ m_objNCO

NCO DATVDemod::m_objNCO
private

Definition at line 415 of file datvdemod.h.

Referenced by applyChannelSettings(), applySettings(), and feed().

◆ m_objRegisteredTVScreen

TVScreen* DATVDemod::m_objRegisteredTVScreen
private

Definition at line 405 of file datvdemod.h.

Referenced by SetTVScreen().

◆ m_objRegisteredVideoRender

DATVideoRender* DATVDemod::m_objRegisteredVideoRender
private

◆ m_objRenderThread

DATVideoRenderThread* DATVDemod::m_objRenderThread
private

Definition at line 409 of file datvdemod.h.

Referenced by PlayVideo(), SetVideoRender(), and ~DATVDemod().

◆ m_objRFFilter

fftfilt* DATVDemod::m_objRFFilter
private

Definition at line 414 of file datvdemod.h.

Referenced by applyChannelSettings(), applySettings(), feed(), and ~DATVDemod().

◆ m_objScheduler

leansdr::scheduler* DATVDemod::m_objScheduler
private

Definition at line 292 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), feed(), InitDATVFramework(), and InitDATVS2Framework().

◆ m_objSettingsMutex

QMutex DATVDemod::m_objSettingsMutex
private

Definition at line 432 of file datvdemod.h.

Referenced by feed().

◆ m_objVideoStream

DATVideostream* DATVDemod::m_objVideoStream
private

Definition at line 407 of file datvdemod.h.

Referenced by PlayVideo(), SetVideoRender(), and ~DATVDemod().

◆ m_sampleRate

int DATVDemod::m_sampleRate
private

◆ m_settings

DATVDemodSettings DATVDemod::m_settings
private

◆ m_threadedChannelizer

ThreadedBasebandSampleSink* DATVDemod::m_threadedChannelizer
private

Definition at line 401 of file datvdemod.h.

Referenced by ~DATVDemod().

◆ m_udpStream

DATVUDPStream DATVDemod::m_udpStream
private

Definition at line 408 of file datvdemod.h.

Referenced by applySettings().

◆ ncoeffs

int DATVDemod::ncoeffs
private

Definition at line 321 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ ncoeffs_sampler

int DATVDemod::ncoeffs_sampler
private

Definition at line 326 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), InitDATVFramework(), and InitDATVS2Framework().

◆ p_autonotched

leansdr::pipebuf<leansdr::cf32>* DATVDemod::p_autonotched
private

Definition at line 307 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), InitDATVFramework(), and InitDATVS2Framework().

◆ p_bbframes

void* DATVDemod::p_bbframes
private

Definition at line 341 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_bytes

leansdr::pipebuf<leansdr::u8>* DATVDemod::p_bytes
private

Definition at line 357 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_cnr

leansdr::pipebuf<leansdr::f32>* DATVDemod::p_cnr
private

Definition at line 314 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), and InitDATVFramework().

◆ p_cstln

leansdr::pipebuf<leansdr::cf32>* DATVDemod::p_cstln
private

Definition at line 336 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), and InitDATVS2Framework().

◆ p_cstln_pls

leansdr::pipebuf<leansdr::cf32>* DATVDemod::p_cstln_pls
private

Definition at line 337 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), and InitDATVS2Framework().

◆ p_decim

leansdr::decimator<leansdr::cf32>* DATVDemod::p_decim
private

Definition at line 348 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_decimated

leansdr::pipebuf<leansdr::cf32>* DATVDemod::p_decimated
private

Definition at line 347 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_deframer

void* DATVDemod::p_deframer
private

Definition at line 344 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_derot

leansdr::pipebuf<leansdr::cf32>* DATVDemod::p_derot
private

Definition at line 310 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_descrambled

leansdr::pipebuf<leansdr::u8>* DATVDemod::p_descrambled
private

Definition at line 360 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_fecframes

void* DATVDemod::p_fecframes
private

Definition at line 340 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_framelock

leansdr::pipebuf<int>* DATVDemod::p_framelock
private

Definition at line 338 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), and InitDATVS2Framework().

◆ p_frames

leansdr::pipebuf<leansdr::u8>* DATVDemod::p_frames
private

Definition at line 361 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_freq

leansdr::pipebuf<leansdr::f32>* DATVDemod::p_freq
private

Definition at line 329 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), InitDATVFramework(), and InitDATVS2Framework().

◆ p_lock

leansdr::pipebuf<int>* DATVDemod::p_lock
private

Definition at line 367 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_locktime

leansdr::pipebuf<leansdr::u32>* DATVDemod::p_locktime
private

Definition at line 368 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_mer

leansdr::pipebuf<leansdr::f32>* DATVDemod::p_mer
private

Definition at line 331 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), InitDATVFramework(), and InitDATVS2Framework().

◆ p_mpegbytes

leansdr::pipebuf<leansdr::u8>* DATVDemod::p_mpegbytes
private

Definition at line 366 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_preprocessed

leansdr::pipebuf<leansdr::cf32>* DATVDemod::p_preprocessed
private

Definition at line 303 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), InitDATVFramework(), and InitDATVS2Framework().

◆ p_rawiq

leansdr::pipebuf<leansdr::cf32>* DATVDemod::p_rawiq
private

Definition at line 301 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), InitDATVFramework(), and InitDATVS2Framework().

◆ p_rawiq_writer

leansdr::pipewriter<leansdr::cf32>* DATVDemod::p_rawiq_writer
private

Definition at line 302 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), feed(), InitDATVFramework(), and InitDATVS2Framework().

◆ p_resampled

leansdr::pipebuf<leansdr::cf32>* DATVDemod::p_resampled
private

Definition at line 319 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_rspackets

leansdr::pipebuf<leansdr::rspacket<leansdr::u8> >* DATVDemod::p_rspackets
private

Definition at line 373 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_rtspackets

leansdr::pipebuf<leansdr::tspacket>* DATVDemod::p_rtspackets
private

Definition at line 379 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_s2_deinterleaver

void* DATVDemod::p_s2_deinterleaver
private

Definition at line 342 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_sampled

leansdr::pipebuf<leansdr::cf32>* DATVDemod::p_sampled
private

Definition at line 332 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), and InitDATVFramework().

◆ p_slots_dvbs2

void* DATVDemod::p_slots_dvbs2
private

Definition at line 335 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), and InitDATVS2Framework().

◆ p_ss

leansdr::pipebuf<leansdr::f32>* DATVDemod::p_ss
private

Definition at line 330 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), InitDATVFramework(), and InitDATVS2Framework().

◆ p_symbols

leansdr::pipebuf<leansdr::eucl_ss>* DATVDemod::p_symbols
private

Definition at line 328 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), and InitDATVFramework().

◆ p_tspackets

leansdr::pipebuf<leansdr::tspacket>* DATVDemod::p_tspackets
private

Definition at line 387 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_vber

leansdr::pipebuf<float>* DATVDemod::p_vber
private

Definition at line 383 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_vbitcount

leansdr::pipebuf<int>* DATVDemod::p_vbitcount
private

Definition at line 377 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ p_verrcount

leansdr::pipebuf<int>* DATVDemod::p_verrcount
private

Definition at line 378 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r

leansdr::viterbi_sync* DATVDemod::r
private

Definition at line 359 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_auto_notch

leansdr::auto_notch<leansdr::f32>* DATVDemod::r_auto_notch
private

Definition at line 306 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), InitDATVFramework(), and InitDATVS2Framework().

◆ r_cnr

leansdr::cnr_fft<leansdr::f32>* DATVDemod::r_cnr
private

Definition at line 315 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), and InitDATVFramework().

◆ r_deconv

leansdr::deconvol_sync_simple* DATVDemod::r_deconv
private

Definition at line 358 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_deinter

leansdr::deinterleaver<leansdr::u8>* DATVDemod::r_deinter
private

Definition at line 374 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_derand

leansdr::derandomizer* DATVDemod::r_derand
private

Definition at line 388 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_derot

leansdr::rotator<leansdr::f32>* DATVDemod::r_derot
private

Definition at line 311 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_etr192_descrambler

leansdr::etr192_descrambler* DATVDemod::r_etr192_descrambler
private

Definition at line 363 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_fecdec

void* DATVDemod::r_fecdec
private

Definition at line 343 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_ppout

leansdr::file_writer<leansdr::cf32>* DATVDemod::r_ppout
private

Definition at line 351 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_resample

leansdr::fir_filter<leansdr::cf32,float>* DATVDemod::r_resample
private

Definition at line 318 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_rsdec

leansdr::rs_decoder<leansdr::u8, 0>* DATVDemod::r_rsdec
private

Definition at line 380 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_scope_symbols

leansdr::datvconstellation<leansdr::f32>* DATVDemod::r_scope_symbols
private

Definition at line 396 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_scope_symbols_dvbs2

leansdr::datvdvbs2constellation<leansdr::f32>* DATVDemod::r_scope_symbols_dvbs2
private

Definition at line 397 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), and feed().

◆ r_stdout

leansdr::file_writer<leansdr::tspacket>* DATVDemod::r_stdout
private

Definition at line 392 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_sync

leansdr::hdlc_sync* DATVDemod::r_sync
private

Definition at line 364 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_sync_mpeg

leansdr::mpeg_sync<leansdr::u8, 0>* DATVDemod::r_sync_mpeg
private

Definition at line 369 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_vber

leansdr::rate_estimator<float>* DATVDemod::r_vber
private

Definition at line 384 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ r_videoplayer

leansdr::datvvideoplayer<leansdr::tspacket>* DATVDemod::r_videoplayer
private

Definition at line 393 of file datvdemod.h.

Referenced by CleanUpDATVFramework().

◆ S2_MAX_SYMBOLS

unsigned long DATVDemod::S2_MAX_SYMBOLS
private

Definition at line 288 of file datvdemod.h.

Referenced by InitDATVS2Framework().

◆ sampler

leansdr::sampler_interface<leansdr::f32>* DATVDemod::sampler
private

Definition at line 324 of file datvdemod.h.

Referenced by CleanUpDATVFramework(), InitDATVFramework(), and InitDATVS2Framework().


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