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.
atvdemod.h
Go to the documentation of this file.
1 // Copyright (C) 2017 F4HKW //
3 // for F4EXB / SDRAngel //
4 // //
5 // This program is free software; you can redistribute it and/or modify //
6 // it under the terms of the GNU General Public License as published by //
7 // the Free Software Foundation as version 3 of the License, or //
8 // (at your option) any later version. //
9 // //
10 // This program is distributed in the hope that it will be useful, //
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
13 // GNU General Public License V3 for more details. //
14 // //
15 // You should have received a copy of the GNU General Public License //
16 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
18 
19 #ifndef INCLUDE_ATVDEMOD_H
20 #define INCLUDE_ATVDEMOD_H
21 
22 #include <QMutex>
23 #include <QElapsedTimer>
24 #include <vector>
25 
26 #include "dsp/basebandsamplesink.h"
27 #include "channel/channelapi.h"
28 #include "dsp/devicesamplesource.h"
29 #include "dsp/dspcommands.h"
30 #include "dsp/downchannelizer.h"
31 #include "dsp/nco.h"
32 #include "dsp/interpolator.h"
33 #include "util/movingaverage.h"
34 #include "dsp/fftfilt.h"
35 #include "dsp/agc.h"
36 #include "dsp/phaselock.h"
37 #include "dsp/recursivefilters.h"
38 #include "dsp/phasediscri.h"
39 #include "audio/audiofifo.h"
40 #include "util/message.h"
41 #include "gui/tvscreen.h"
42 
43 class DeviceAPI;
45 class DownChannelizer;
46 
47 class ATVDemod : public BasebandSampleSink, public ChannelAPI
48 {
49  Q_OBJECT
50 
51 public:
52 
53  enum ATVStd
54  {
61  };
62 
71  };
72 
73  struct ATVConfig
74  {
84  bool m_blnHSync;
85  bool m_blnVSync;
88 
90  m_intSampleRate(0),
91  m_enmATVStandard(ATVStdPAL625),
92  m_intNumberOfLines(625),
93  m_fltLineDuration(0.0f),
94  m_fltTopDuration(0.0f),
95  m_fltFramePerS(25.0f),
96  m_fltRatioOfRowsToDisplay(0.0f),
97  m_fltVoltLevelSynchroTop(0.0f),
98  m_fltVoltLevelSynchroBlack(1.0f),
99  m_blnHSync(false),
100  m_blnVSync(false),
101  m_blnInvertVideo(false),
102  m_intVideoTabIndex(0)
103  {
104  }
105  };
106 
107  struct ATVRFConfig
108  {
117 
119  m_intFrequencyOffset(0),
120  m_enmModulation(ATV_FM1),
121  m_fltRFBandwidth(0),
122  m_fltRFOppBandwidth(0),
123  m_blnFFTFiltering(false),
124  m_blndecimatorEnable(false),
125  m_fltBFOFrequency(0.0f),
126  m_fmDeviation(1.0f)
127  {
128  }
129  };
130 
133 
134  public:
135  int getCenterFrequency() const { return m_centerFrequency; }
136 
137  static MsgConfigureChannelizer* create(int centerFrequency)
138  {
139  return new MsgConfigureChannelizer(centerFrequency);
140  }
141 
142  private:
144 
145  MsgConfigureChannelizer(int centerFrequency) :
146  Message(),
147  m_centerFrequency(centerFrequency)
148  { }
149  };
150 
152  {
154 
155  public:
156  int getSampleRate() const { return m_sampleRate; }
157  int getNbPointsPerLine() const { return m_nbPointsPerLine; }
158 
159  static MsgReportEffectiveSampleRate* create(int sampleRate, int nbPointsPerLine)
160  {
161  return new MsgReportEffectiveSampleRate(sampleRate, nbPointsPerLine);
162  }
163 
164  protected:
167 
168  MsgReportEffectiveSampleRate(int sampleRate, int nbPointsPerLine) :
169  Message(),
170  m_sampleRate(sampleRate),
171  m_nbPointsPerLine(nbPointsPerLine)
172  { }
173  };
174 
177 
178  public:
179  int getSampleRate() const { return m_sampleRate; }
180 
182  {
183  return new MsgReportChannelSampleRateChanged(sampleRate);
184  }
185 
186  private:
188 
190  Message(),
191  m_sampleRate(sampleRate)
192  { }
193  };
194 
195  ATVDemod(DeviceAPI *deviceAPI);
196  ~ATVDemod();
197  virtual void destroy() { delete this; }
198  void setScopeSink(BasebandSampleSink* scopeSink) { m_scopeSink = scopeSink; }
199 
200  void configure(MessageQueue* objMessageQueue,
201  float fltLineDurationUs,
202  float fltTopDurationUs,
203  float fltFramePerS,
204  ATVStd enmATVStandard,
205  int intNumberOfLines,
206  float fltRatioOfRowsToDisplay,
207  float fltVoltLevelSynchroTop,
208  float fltVoltLevelSynchroBlack,
209  bool blnHSync,
210  bool blnVSync,
211  bool blnInvertVideo,
212  int intVideoTabIndex);
213 
214  void configureRF(MessageQueue* objMessageQueue,
215  int64_t frequencyOffset,
216  ATVModulation enmModulation,
217  float fltRFBandwidth,
218  float fltRFOppBandwidth,
219  bool blnFFTFiltering,
220  bool blndecimatorEnable,
221  float fltBFOFrequency,
222  float fmDeviation);
223 
224  virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
225  virtual void start();
226  virtual void stop();
227  virtual bool handleMessage(const Message& cmd);
228 
229  virtual void getIdentifier(QString& id) { id = objectName(); }
230  virtual void getTitle(QString& title) { title = objectName(); }
231  virtual qint64 getCenterFrequency() const { return m_rfRunning.m_intFrequencyOffset; }
232 
233  virtual QByteArray serialize() const { return QByteArray(); }
234  virtual bool deserialize(const QByteArray& data) { (void) data; return false; }
235 
236  virtual int getNbSinkStreams() const { return 1; }
237  virtual int getNbSourceStreams() const { return 0; }
238 
239  virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
240  {
241  (void) streamIndex;
242  (void) sinkElseSource;
244  }
245 
246  void setTVScreen(TVScreen *objScreen);
247  int getSampleRate();
249  double getMagSq() const { return m_objMagSqAverage; }
250  bool getBFOLocked();
251 
252  static const QString m_channelIdURI;
253  static const QString m_channelId;
254 
255 private slots:
257 
258 private:
260  {
263 
265  m_intTVSampleRate(0),
266  m_intNumberSamplePerLine(0)
267  {}
268  };
269 
271  {
273 
274  public:
276  float fltLineDurationUs,
277  float fltTopDurationUs,
278  float fltFramePerS,
279  ATVStd enmATVStandard,
280  int intNumberOfLines,
281  float fltRatioOfRowsToDisplay,
282  float fltVoltLevelSynchroTop,
283  float fltVoltLevelSynchroBlack,
284  bool blnHSync,
285  bool blnVSync,
286  bool blnInvertVideo,
287  int intVideoTabIndex)
288  {
289  return new MsgConfigureATVDemod(
290  fltLineDurationUs,
291  fltTopDurationUs,
292  fltFramePerS,
293  enmATVStandard,
294  intNumberOfLines,
295  fltRatioOfRowsToDisplay,
296  fltVoltLevelSynchroTop,
297  fltVoltLevelSynchroBlack,
298  blnHSync,
299  blnVSync,
300  blnInvertVideo,
301  intVideoTabIndex);
302  }
303 
305 
306  private:
308  float fltLineDurationUs,
309  float fltTopDurationUs,
310  float fltFramePerS,
311  ATVStd enmATVStandard,
312  int intNumberOfLines,
313  float flatRatioOfRowsToDisplay,
314  float fltVoltLevelSynchroTop,
315  float fltVoltLevelSynchroBlack,
316  bool blnHSync,
317  bool blnVSync,
318  bool blnInvertVideo,
319  int intVideoTabIndex) :
320  Message()
321  {
322  m_objMsgConfig.m_fltVoltLevelSynchroBlack = fltVoltLevelSynchroBlack;
323  m_objMsgConfig.m_fltVoltLevelSynchroTop = fltVoltLevelSynchroTop;
324  m_objMsgConfig.m_fltFramePerS = fltFramePerS;
325  m_objMsgConfig.m_enmATVStandard = enmATVStandard;
326  m_objMsgConfig.m_intNumberOfLines = intNumberOfLines;
327  m_objMsgConfig.m_fltLineDuration = fltLineDurationUs;
328  m_objMsgConfig.m_fltTopDuration = fltTopDurationUs;
329  m_objMsgConfig.m_fltRatioOfRowsToDisplay = flatRatioOfRowsToDisplay;
330  m_objMsgConfig.m_blnHSync = blnHSync;
331  m_objMsgConfig.m_blnVSync = blnVSync;
332  m_objMsgConfig.m_blnInvertVideo = blnInvertVideo;
333  m_objMsgConfig.m_intVideoTabIndex = intVideoTabIndex;
334  }
335  };
336 
338  {
340 
341  public:
343  int64_t frequencyOffset,
344  ATVModulation enmModulation,
345  float fltRFBandwidth,
346  float fltRFOppBandwidth,
347  bool blnFFTFiltering,
348  bool blndecimatorEnable,
349  int intBFOFrequency,
350  float fmDeviation)
351  {
352  return new MsgConfigureRFATVDemod(
353  frequencyOffset,
354  enmModulation,
355  fltRFBandwidth,
356  fltRFOppBandwidth,
357  blnFFTFiltering,
358  blndecimatorEnable,
359  intBFOFrequency,
360  fmDeviation);
361  }
362 
364 
365  private:
367  int64_t frequencyOffset,
368  ATVModulation enmModulation,
369  float fltRFBandwidth,
370  float fltRFOppBandwidth,
371  bool blnFFTFiltering,
372  bool blndecimatorEnable,
373  float fltBFOFrequency,
374  float fmDeviation) :
375  Message()
376  {
377  m_objMsgConfig.m_intFrequencyOffset = frequencyOffset;
378  m_objMsgConfig.m_enmModulation = enmModulation;
379  m_objMsgConfig.m_fltRFBandwidth = fltRFBandwidth;
380  m_objMsgConfig.m_fltRFOppBandwidth = fltRFOppBandwidth;
381  m_objMsgConfig.m_blnFFTFiltering = blnFFTFiltering;
382  m_objMsgConfig.m_blndecimatorEnable = blndecimatorEnable;
383  m_objMsgConfig.m_fltBFOFrequency = fltBFOFrequency;
384  m_objMsgConfig.m_fmDeviation = fmDeviation;
385  }
386  };
387 
391  class AvgExpInt
392  {
393  public:
394  AvgExpInt(int log2Alpha) : m_log2Alpha(log2Alpha), m_m1(0), m_start(true) {}
395  void reset() { m_start = true; }
396 
397  int run(int m0)
398  {
399  if (m_start)
400  {
401  m_m1 = m0;
402  m_start = false;
403  return m0;
404  }
405  else
406  {
407  m_m1 = m0 + m_m1 - (m_m1>>m_log2Alpha);
408  return m_m1>>m_log2Alpha;
409  }
410  }
411 
412  private:
414  int m_m1;
415  bool m_start;
416  };
417 
421 
422  //*************** SCOPE ***************
423 
426 
427  //*************** ATV PARAMETERS ***************
429 
430  //int m_intNumberSamplePerLine;
439 
440  //*************** PROCESSING ***************
441 
444 
447 
449 
450  float m_fltEffMin;
451  float m_fltEffMax;
452 
453  float m_fltAmpMin;
454  float m_fltAmpMax;
456 
457  float m_fltBufferI[6];
458  float m_fltBufferQ[6];
459 
464 
467 
469 
470  //*************** RF ***************
471 
473 
477 
478  // Interpolator group for decimation and/or double sideband RF filtering
482 
483  // Used for vestigial SSB with asymmetrical filtering (needs double sideband scheme)
487  static const int m_ssbFftLen;
488 
489  // Used for FM
491 
492  //QElapsedTimer m_objTimer;
493 
496 
499 
502 
504 
505  void applySettings();
506  void applyStandard();
507  void demod(Complex& c);
508  static float getRFBandwidthDivisor(ATVModulation modulation);
509 
510  inline void processHSkip(float& fltVal, int& intVal)
511  {
512  m_registeredTVScreen->setDataColor(m_intColIndex - m_intNumberSaplesPerHSync + m_intNumberSamplePerTop, intVal, intVal, intVal);
513 
514  // Horizontal Synchro detection
515 
516  // Floor Detection 0
517  if (fltVal < m_running.m_fltVoltLevelSynchroTop)
518  {
519  m_intSynchroPoints++;
520  }
521  // Black detection 0.3
522  else if (fltVal > m_running.m_fltVoltLevelSynchroBlack)
523  {
524  m_intSynchroPoints = 0;
525  }
526 
527  // sync pulse
528 
529  m_blnSynchroDetected = (m_intSynchroPoints == m_intNumberSamplePerTop);
530 
531  if (m_blnSynchroDetected)
532  {
533  if (m_intSampleIndex >= (3 * m_runningPrivate.m_intNumberSamplePerLine)/2) // first after skip
534  {
535  //qDebug("VSync: %d %d %d", m_intColIndex, m_intSampleIndex, m_intLineIndex);
536  m_intAvgColIndex = m_intColIndex;
537  m_registeredTVScreen->renderImage(0);
538 
539  m_intImageIndex++;
540  m_intLineIndex = 0;
541  m_intRowIndex = 0;
542  }
543 
544  m_intSampleIndex = 0;
545  }
546  else
547  {
548  m_intSampleIndex++;
549  }
550 
551  if (m_intColIndex < m_runningPrivate.m_intNumberSamplePerLine + m_intNumberSamplePerTop - 1)
552  {
553  m_intColIndex++;
554  }
555  else
556  {
557  if (m_running.m_blnHSync && (m_intLineIndex == 0))
558  {
559  //qDebug("HCorr: %d", m_intAvgColIndex);
560  m_intColIndex = m_intNumberSamplePerTop + (m_runningPrivate.m_intNumberSamplePerLine - m_intAvgColIndex)/2; // amortizing factor 1/2
561  }
562  else
563  {
564  m_intColIndex = m_intNumberSamplePerTop;
565  }
566 
567  if ((m_rfRunning.m_enmModulation == ATV_AM)
568  || (m_rfRunning.m_enmModulation == ATV_USB)
569  || (m_rfRunning.m_enmModulation == ATV_LSB))
570  {
571  m_fltAmpMin = m_fltEffMin;
572  m_fltAmpMax = m_fltEffMax;
573  m_fltAmpDelta = m_fltEffMax-m_fltEffMin;
574 
575  if(m_fltAmpDelta<=0.0)
576  {
577  m_fltAmpDelta=1.0f;
578  }
579 
580  //Reset extrema
581  m_fltEffMin = 2000000.0f;
582  m_fltEffMax = -2000000.0f;
583  }
584 
585  m_registeredTVScreen->selectRow(m_intRowIndex);
586  m_intLineIndex++;
587  m_intRowIndex++;
588  }
589  }
590 
591  inline void processClassic(float& fltVal, int& intVal)
592  {
593  int intSynchroTimeSamples= (3 * m_runningPrivate.m_intNumberSamplePerLine)/4;
594  float fltSynchroTrameLevel = 0.5f*((float)intSynchroTimeSamples) * m_running.m_fltVoltLevelSynchroBlack;
595 
596  // Horizontal Synchro detection
597 
598  // Floor Detection 0
599  if (fltVal < m_running.m_fltVoltLevelSynchroTop)
600  {
601  m_intSynchroPoints++;
602  }
603  // Black detection 0.3
604  else if (fltVal > m_running.m_fltVoltLevelSynchroBlack)
605  {
606  m_intSynchroPoints = 0;
607  }
608 
609  m_blnSynchroDetected = (m_intSynchroPoints == m_intNumberSamplePerTop);
610 
611  //Horizontal Synchro processing
612 
613  bool blnNewLine = false;
614 
615  if (m_blnSynchroDetected)
616  {
617  m_intAvgColIndex = m_intSampleIndex - m_intColIndex - (m_intColIndex < m_runningPrivate.m_intNumberSamplePerLine/2 ? 150 : 0);
618  //qDebug("HSync: %d %d %d", m_intSampleIndex, m_intColIndex, m_intAvgColIndex);
619  m_intSampleIndex = 0;
620  }
621  else
622  {
623  m_intSampleIndex++;
624  }
625 
626  if (!m_running.m_blnHSync && (m_intColIndex >= m_runningPrivate.m_intNumberSamplePerLine)) // H Sync not active
627  {
628  m_intColIndex = 0;
629  blnNewLine = true;
630  }
631  else if (m_intColIndex >= m_runningPrivate.m_intNumberSamplePerLine + m_intNumberSamplePerTop) // No valid H sync
632  {
633  if (m_running.m_blnHSync && (m_intLineIndex == 0))
634  {
635  //qDebug("HSync: %d %d", m_intColIndex, m_intAvgColIndex);
636  m_intColIndex = m_intNumberSamplePerTop + m_intAvgColIndex/4; // amortizing 1/4
637  }
638  else
639  {
640  m_intColIndex = m_intNumberSamplePerTop;
641  }
642 
643  blnNewLine = true;
644  }
645 
646  if (blnNewLine)
647  {
648  if ((m_rfRunning.m_enmModulation == ATV_AM)
649  || (m_rfRunning.m_enmModulation == ATV_USB)
650  || (m_rfRunning.m_enmModulation == ATV_LSB))
651  {
652  m_fltAmpMin = m_fltEffMin;
653  m_fltAmpMax = m_fltEffMax;
654  m_fltAmpDelta = m_fltEffMax-m_fltEffMin;
655 
656  if(m_fltAmpDelta<=0.0)
657  {
658  m_fltAmpDelta=1.0f;
659  }
660 
661  //Reset extrema
662  m_fltEffMin = 2000000.0f;
663  m_fltEffMax = -2000000.0f;
664  }
665 
666  m_fltAmpLineAverage=0.0f;
667 
668  //New line + Interleaving
669  m_intRowIndex += m_interleaved ? 2 : 1;
670 
671  if (m_intRowIndex < m_intNumberOfLines)
672  {
673  m_registeredTVScreen->selectRow(m_intRowIndex - m_intNumberOfSyncLines);
674  }
675 
676  m_intLineIndex++;
677  }
678 
679  // Filling pixels
680 
681  // +4 is to compensate shift due to hsync amortizing factor of 1/4
682  m_registeredTVScreen->setDataColor(m_intColIndex - m_intNumberSaplesPerHSync + m_intNumberSamplePerTop + 4, intVal, intVal, intVal);
683  m_intColIndex++;
684 
685  // Vertical sync and image rendering
686 
687  if ((m_running.m_blnVSync) && (m_intLineIndex < m_intNumberOfLines)) // VSync activated and lines in range
688  {
689  if (m_intColIndex >= intSynchroTimeSamples)
690  {
691  if (m_fltAmpLineAverage <= fltSynchroTrameLevel)
692  {
693  m_fltAmpLineAverage = 0.0f;
694 
695  if (!m_blnVerticalSynchroDetected) // not yet
696  {
697  m_blnVerticalSynchroDetected = true; // prevent repetition
698 
699  if ((m_intLineIndex % 2 == 0) || !m_interleaved) // even => odd image
700  {
701  m_registeredTVScreen->renderImage(0);
702  m_intRowIndex = 1;
703  }
704  else
705  {
706  m_intRowIndex = 0;
707  }
708 
709  m_registeredTVScreen->selectRow(m_intRowIndex - m_intNumberOfSyncLines);
710  m_intLineIndex = 0;
711  m_intImageIndex++;
712  }
713  }
714  else
715  {
716  m_blnVerticalSynchroDetected = false; // reset
717  }
718  }
719  }
720  else // no VSync or lines out of range => arbitrary
721  {
722  if (m_intLineIndex >= m_intNumberOfLines/2)
723  {
724  if (m_intImageIndex % 2 == 1) // odd image
725  {
726  m_registeredTVScreen->renderImage(0);
727 
728  if (m_rfRunning.m_enmModulation == ATV_AM)
729  {
730  m_fltAmpMin = m_fltEffMin;
731  m_fltAmpMax = m_fltEffMax;
732  m_fltAmpDelta = m_fltEffMax-m_fltEffMin;
733 
734  if(m_fltAmpDelta<=0.0)
735  {
736  m_fltAmpDelta=1.0f;
737  }
738 
739  //Reset extrema
740  m_fltEffMin = 2000000.0f;
741  m_fltEffMax = -2000000.0f;
742  }
743 
744  m_intRowIndex = 1;
745  }
746  else
747  {
748  m_intRowIndex = 0;
749  }
750 
751  m_registeredTVScreen->selectRow(m_intRowIndex - m_intNumberOfSyncLines);
752  m_intLineIndex = 0;
753  m_intImageIndex++;
754  }
755  }
756  }
757 };
758 
759 #endif // INCLUDE_ATVDEMOD_H
virtual int getNbSourceStreams() const
Definition: atvdemod.h:237
bool setDataColor(int intCol, int intRed, int intGreen, int intBlue)
Definition: tvscreen.cpp:224
virtual void destroy()
Definition: atvdemod.h:197
virtual qint64 getCenterFrequency() const
Applies to a default stream.
Definition: atvdemod.h:231
virtual void stop()
Definition: atvdemod.cpp:453
ATVConfigPrivate m_runningPrivate
Definition: atvdemod.h:500
std::vector< Sample > SampleVector
Definition: dsptypes.h:96
void processClassic(float &fltVal, int &intVal)
Definition: atvdemod.h:591
AM with vestigial lower side band (main signal is in the upper side)
Definition: atvdemod.h:68
Classical frequency modulation with discriminator #2.
Definition: atvdemod.h:65
void demod(Complex &c)
Definition: atvdemod.cpp:248
ATVRFConfig m_rfRunning
Definition: atvdemod.h:497
SampleVector m_sampleBuffer
Definition: atvdemod.h:468
int m_intLineIndex
Definition: atvdemod.h:463
ATVStd m_enmATVStandard
Definition: atvdemod.h:76
AvgExpInt(int log2Alpha)
Definition: atvdemod.h:394
No modulation just produces zeros.
Definition: atvdemod.h:70
int64_t m_intFrequencyOffset
Definition: atvdemod.h:109
MovingAverageUtil< double, double, 32 > m_objMagSqAverage
Definition: atvdemod.h:472
void renderImage(unsigned char *objData)
Definition: tvscreen.cpp:70
MsgConfigureChannelizer(int centerFrequency)
Definition: atvdemod.h:145
static const QString m_channelIdURI
Definition: atvdemod.h:252
void configure(MessageQueue *objMessageQueue, float fltLineDurationUs, float fltTopDurationUs, float fltFramePerS, ATVStd enmATVStandard, int intNumberOfLines, float fltRatioOfRowsToDisplay, float fltVoltLevelSynchroTop, float fltVoltLevelSynchroBlack, bool blnHSync, bool blnVSync, bool blnInvertVideo, int intVideoTabIndex)
Definition: atvdemod.cpp:114
void configureRF(MessageQueue *objMessageQueue, int64_t frequencyOffset, ATVModulation enmModulation, float fltRFBandwidth, float fltRFOppBandwidth, bool blnFFTFiltering, bool blndecimatorEnable, float fltBFOFrequency, float fmDeviation)
Definition: atvdemod.cpp:145
virtual void feed(const SampleVector::const_iterator &begin, const SampleVector::const_iterator &end, bool po)
Definition: atvdemod.cpp:168
int m_intNumberSamplePerTop
Definition: atvdemod.h:431
float m_fltAmpDelta
Definition: atvdemod.h:455
int getEffectiveSampleRate()
Definition: atvdemod.cpp:741
int m_intNumberOfEqLines
number of equalizing lines both whole and partial
Definition: atvdemod.h:435
MsgConfigureRFATVDemod(int64_t frequencyOffset, ATVModulation enmModulation, float fltRFBandwidth, float fltRFOppBandwidth, bool blnFFTFiltering, bool blndecimatorEnable, float fltBFOFrequency, float fmDeviation)
Definition: atvdemod.h:366
static MsgReportEffectiveSampleRate * create(int sampleRate, int nbPointsPerLine)
Definition: atvdemod.h:159
ATVModulation
Definition: atvdemod.h:63
AvgExpInt m_objAvgColIndex
Definition: atvdemod.h:465
bool getBFOLocked()
Definition: atvdemod.cpp:746
int m_intNumberOfBlackLines
this is the total number of lines not part of the image and is used for vertical screen size ...
Definition: atvdemod.h:434
float m_fltBufferI[6]
Definition: atvdemod.h:457
MsgReportEffectiveSampleRate(int sampleRate, int nbPointsPerLine)
Definition: atvdemod.h:168
static MsgReportChannelSampleRateChanged * create(int sampleRate)
Definition: atvdemod.h:181
float m_fltRatioOfRowsToDisplay
Definition: atvdemod.h:81
__int64 int64_t
Definition: rtptypes_win.h:47
virtual void getIdentifier(QString &id)
Definition: atvdemod.h:229
SampleVector m_scopeSampleBuffer
Definition: atvdemod.h:425
Interpolator m_interpolator
Definition: atvdemod.h:479
float m_fltTopDuration
Definition: atvdemod.h:79
int m_DSBFilterBufferIndex
Definition: atvdemod.h:486
Classical frequency modulation with phase derivative discriminator.
Definition: atvdemod.h:66
virtual bool handleMessage(const Message &cmd)
Processing of a message. Returns true if message has actually been processed.
Definition: atvdemod.cpp:457
QMutex m_objSettingsMutex
Definition: atvdemod.h:503
float m_fltFramePerS
Definition: atvdemod.h:80
int getSampleRate()
Definition: atvdemod.cpp:736
~ATVDemod()
Definition: atvdemod.cpp:99
int m_intAvgColIndex
Definition: atvdemod.h:466
ATVConfig m_running
Definition: atvdemod.h:494
float m_fltBufferQ[6]
Definition: atvdemod.h:458
Definition: nco.h:25
virtual void getTitle(QString &title)
Definition: atvdemod.h:230
virtual void start()
Definition: atvdemod.cpp:448
NCO m_nco
Definition: atvdemod.h:474
static MsgConfigureATVDemod * create(float fltLineDurationUs, float fltTopDurationUs, float fltFramePerS, ATVStd enmATVStandard, int intNumberOfLines, float fltRatioOfRowsToDisplay, float fltVoltLevelSynchroTop, float fltVoltLevelSynchroBlack, bool blnHSync, bool blnVSync, bool blnInvertVideo, int intVideoTabIndex)
Definition: atvdemod.h:275
static const QString m_channelId
Definition: atvdemod.h:253
#define MESSAGE_CLASS_DECLARATION
Definition: message.h:43
int m_intNumberSamplePerLineSignals
number of samples in the non image part of the line (signals)
Definition: atvdemod.h:436
int m_intSampleIndex
Definition: atvdemod.h:461
ATVDemod(DeviceAPI *deviceAPI)
Definition: atvdemod.cpp:42
int m_intImageIndex
Definition: atvdemod.h:442
void applyStandard()
Definition: atvdemod.cpp:683
static const int m_ssbFftLen
Definition: atvdemod.h:487
void applySettings()
Definition: atvdemod.cpp:541
static float getRFBandwidthDivisor(ATVModulation modulation)
Definition: atvdemod.cpp:758
MsgConfigureATVDemod(float fltLineDurationUs, float fltTopDurationUs, float fltFramePerS, ATVStd enmATVStandard, int intNumberOfLines, float flatRatioOfRowsToDisplay, float fltVoltLevelSynchroTop, float fltVoltLevelSynchroBlack, bool blnHSync, bool blnVSync, bool blnInvertVideo, int intVideoTabIndex)
Definition: atvdemod.h:307
ATVRFConfig m_rfConfig
Definition: atvdemod.h:498
ATVConfigPrivate m_configPrivate
Definition: atvdemod.h:501
int m_intNumberSaplesPerHSync
number of samples per horizontal synchronization pattern (pulse + back porch)
Definition: atvdemod.h:437
ThreadedBasebandSampleSink * m_threadedChannelizer
Definition: atvdemod.h:419
SimplePhaseLock m_bfoPLL
Definition: atvdemod.h:475
ATVConfig m_config
Definition: atvdemod.h:495
static MsgConfigureChannelizer * create(int centerFrequency)
Definition: atvdemod.h:137
ATVModulation m_enmModulation
Definition: atvdemod.h:110
TVScreen * m_registeredTVScreen
Definition: atvdemod.h:428
BasebandSampleSink * m_scopeSink
Definition: atvdemod.h:424
int m_intRowIndex
Definition: atvdemod.h:462
Classical amplitude modulation.
Definition: atvdemod.h:67
PhaseDiscriminators m_objPhaseDiscri
Definition: atvdemod.h:490
int m_intSynchroPoints
Definition: atvdemod.h:443
float m_fltLineDuration
Definition: atvdemod.h:78
void channelSampleRateChanged()
Definition: atvdemod.cpp:774
Complex * m_DSBFilterBuffer
Definition: atvdemod.h:485
bool m_blnVerticalSynchroDetected
Definition: atvdemod.h:446
void setScopeSink(BasebandSampleSink *scopeSink)
Definition: atvdemod.h:198
float m_fltEffMax
Definition: atvdemod.h:451
bool m_interleaved
interleaved image
Definition: atvdemod.h:438
float m_fltVoltLevelSynchroTop
Definition: atvdemod.h:82
int m_intColIndex
Definition: atvdemod.h:460
bool m_blnSynchroDetected
Definition: atvdemod.h:445
virtual bool deserialize(const QByteArray &data)
Definition: atvdemod.h:234
void setTVScreen(TVScreen *objScreen)
set by the GUI
Definition: atvdemod.cpp:109
float m_fltAmpMin
Definition: atvdemod.h:453
SecondOrderRecursiveFilter m_bfoFilter
Definition: atvdemod.h:476
int run(int m0)
Definition: atvdemod.h:397
float m_fltVoltLevelSynchroBlack
Definition: atvdemod.h:83
float m_fltAmpLineAverage
Definition: atvdemod.h:448
double getMagSq() const
Beware this is scaled to 2^30.
Definition: atvdemod.h:249
virtual QByteArray serialize() const
Definition: atvdemod.h:233
Real m_interpolatorDistanceRemain
Definition: atvdemod.h:481
float m_fltAmpMax
Definition: atvdemod.h:454
static MsgConfigureRFATVDemod * create(int64_t frequencyOffset, ATVModulation enmModulation, float fltRFBandwidth, float fltRFOppBandwidth, bool blnFFTFiltering, bool blndecimatorEnable, int intBFOFrequency, float fmDeviation)
Definition: atvdemod.h:342
int m_intNumberOfLines
Definition: atvdemod.h:432
fftfilt * m_DSBFilter
Definition: atvdemod.h:484
std::complex< Real > Complex
Definition: dsptypes.h:43
int m_intNumberOfSyncLines
this is the number of non displayable lines at the start of a frame. First displayable row comes next...
Definition: atvdemod.h:433
void processHSkip(float &fltVal, int &intVal)
Definition: atvdemod.h:510
float Real
Definition: dsptypes.h:42
Real m_interpolatorDistance
Definition: atvdemod.h:480
DeviceAPI * m_deviceAPI
Definition: atvdemod.h:418
DownChannelizer * m_channelizer
Definition: atvdemod.h:420
float m_fltEffMin
Definition: atvdemod.h:450
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
Definition: atvdemod.h:239
bool selectRow(int intLine)
Definition: tvscreen.cpp:212
AM with vestigial upper side band (main signal is in the lower side)
Definition: atvdemod.h:69
Classical frequency modulation with discriminator #1.
Definition: atvdemod.h:64
virtual int getNbSinkStreams() const
Definition: atvdemod.h:236