From 6f9a044ddc1c1793f7e57c3ade2fb63b4c8dce49 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 8 Apr 2017 05:35:09 +0200 Subject: [PATCH] ATV: use skip instead of leap for the horizontal sync skip mode --- plugins/channelrx/demodatv/atvdemod.cpp | 6 +-- plugins/channelrx/demodatv/atvdemod.h | 6 +-- plugins/channelrx/demodatv/atvdemodgui.ui | 2 +- plugins/channelrx/demodatv/readme.md | 26 ++++++----- plugins/channeltx/modatv/atvmod.cpp | 4 +- plugins/channeltx/modatv/atvmod.h | 2 +- plugins/channeltx/modatv/atvmodgui.ui | 2 +- plugins/channeltx/modatv/readme.md | 53 ++++++++++++++++++++++- 8 files changed, 76 insertions(+), 25 deletions(-) diff --git a/plugins/channelrx/demodatv/atvdemod.cpp b/plugins/channelrx/demodatv/atvdemod.cpp index d5060c98b..c7463d65e 100644 --- a/plugins/channelrx/demodatv/atvdemod.cpp +++ b/plugins/channelrx/demodatv/atvdemod.cpp @@ -427,9 +427,9 @@ void ATVDemod::demod(Complex& c) //********** process video sample ********** - if (m_objRunning.m_enmATVStandard == ATVStdHLeap) + if (m_objRunning.m_enmATVStandard == ATVStdHSkip) { - processHLeap(fltVal, intVal); + processHSkip(fltVal, intVal); } else { @@ -645,7 +645,7 @@ void ATVDemod::applyStandard() { switch(m_objConfig.m_enmATVStandard) { - case ATVStdHLeap: + case ATVStdHSkip: // what is left in a line for the image m_intNumberOfSyncLines = 0; m_intNumberOfBlackLines = 0; diff --git a/plugins/channelrx/demodatv/atvdemod.h b/plugins/channelrx/demodatv/atvdemod.h index a8c3dd65e..512cbeb2c 100644 --- a/plugins/channelrx/demodatv/atvdemod.h +++ b/plugins/channelrx/demodatv/atvdemod.h @@ -52,7 +52,7 @@ public: ATVStd405, ATVStdShortInterleaved, ATVStdShort, - ATVStdHLeap + ATVStdHSkip }; enum ATVModulation { @@ -425,7 +425,7 @@ private: void demod(Complex& c); static float getRFBandwidthDivisor(ATVModulation modulation); - inline void processHLeap(float& fltVal, int& intVal) + inline void processHSkip(float& fltVal, int& intVal) { m_objRegisteredATVScreen->setDataColor(m_intColIndex - m_intNumberSaplesPerHSync + m_intNumberSamplePerTop, intVal, intVal, intVal); @@ -448,7 +448,7 @@ private: if (m_blnSynchroDetected) { - if (m_intSampleIndex >= (3 * m_objRunningPrivate.m_intNumberSamplePerLine)/2) // first after leap + if (m_intSampleIndex >= (3 * m_objRunningPrivate.m_intNumberSamplePerLine)/2) // first after skip { //qDebug("VSync: %d %d %d", m_intColIndex, m_intSampleIndex, m_intLineIndex); m_intAvgColIndex = m_intColIndex; diff --git a/plugins/channelrx/demodatv/atvdemodgui.ui b/plugins/channelrx/demodatv/atvdemodgui.ui index 308133fd0..6e7894161 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.ui +++ b/plugins/channelrx/demodatv/atvdemodgui.ui @@ -666,7 +666,7 @@ - HLeap + HSkip diff --git a/plugins/channelrx/demodatv/readme.md b/plugins/channelrx/demodatv/readme.md index a1beee559..c1692ab81 100644 --- a/plugins/channelrx/demodatv/readme.md +++ b/plugins/channelrx/demodatv/readme.md @@ -44,14 +44,12 @@ This is the channel sample rate in kS/s. For good horizontal synchronization you N = S / (l × F) -The number of points should be a bit larger than the number of lines up to 240 lines then it can be a bit smaller to give an acceptable image quality. +☞ The number of points should be a bit larger than the number of lines up to 240 lines then it can be a bit smaller to give an acceptable image quality.

5: Number of points (or samples) per line

This is the number of points or samples per complete line including sync and padding. This is derived from the sample rate and line frequency as the ratio of the two. For example with a 625 lines × 25 FPS signal the line frequency is 15625 Hz. If the channel sample rate is 1500 kS/s this yields 1500000/15625 = 96 points. If the ratio is not an integer then the integer part is taken. -Picture definition depends largely on this number and the larger the better but it is useless to have a much greater number than the number of points per line used in transmission. -

6: BFO PLL lock indicator

⚠ this is experimental. @@ -79,7 +77,9 @@ Average total power in dB relative to a ±1.0 amplitude signal generated in - USB: ⚠ USB demodulation synchronous to the carrier (experimental) - LSB: ⚠ LSB demodulation synchronous to the carrier (experimental) -For FM choose the algorithm that best suits your conditions. ⚠ only FM3 is accurate with regard to FM deviation (see 10). +For FM choose the algorithm that best suits your conditions. + +☞ only FM3 is accurate with regard to FM deviation (see 10). ⚠ USB and LSB modes are experimental and do not show good results for sample rates greater than 1 MS/s. Adjusting the BFO can be picky and unstable. @@ -87,7 +87,7 @@ For FM choose the algorithm that best suits your conditions. ⚠ only FM3 is Using this button you can adjust the nominal FM deviation as a percentage of the channel bandwidth that is displayed on the right of the button. When a signal with this deviation is received the demodulated signal is in the range -0.5/+0.5 which is shifted to a 0/1 range video signal. -⚠ The value is accurate only with the atan2 differential demodulator i.e. FM3. With FM1 and FM2 you will have to adjust it for best image results. You can use the scope as an aid to try to fit the video signal in the 0/1 range. +☞ The value is accurate only with the atan2 differential demodulator i.e. FM3. With FM1 and FM2 you will have to adjust it for best image results. You can use the scope as an aid to try to fit the video signal in the 0/1 range.

11: FFT asymmetrical filter toggle

@@ -130,11 +130,11 @@ This combo lets you set the TV standard type. This sets the number of lines per - PAL405: this is not the British standard. It just follows the same scheme as the two above but with only 7 black lines per half frame - ShI: this is an experimental mode that uses the least possible vertical sync lines as possible. That is one line for a long synchronization pulse and one line at a higher level (0.7) to reset the vertical sync condition. Thus only 2 lines are consumed for vertical sync and the rest is left to the image. In this mode the frames are interleaved - ShNI: this is the same as above but with non interleaved frames. - - HLeap: this is the horizontal sync leap technique for vertical synchronization. This has been in use in the first TV experiments with a small number of lines. This method just skips one horizontal synchronization pluse to mark the last or the first line (here it is the last). This method does not use any full line for vertical sync and all lines can be used for the image thus it suits the modes with a small number of lines. With more lines however the risk of missing pulses gets higher in adverse conditions because the pulses get shorter and may get swallowed by a stray pulse or a stray pulse can be taken for a valid one. In this case two images might get out of sync instead of just two lines. In practice this is suitable up to 90~120 lines. + - HSkip: this is the horizontal sync skip technique for vertical synchronization. This has been in use in the first TV experiments with a small number of lines. This method just skips one horizontal synchronization pluse to mark the last or the first line (here it is the last). This method does not use any full line for vertical sync and all lines can be used for the image thus it suits the modes with a small number of lines. With more lines however the risk of missing pulses gets higher in adverse conditions because the pulses get shorter and may get swallowed by a stray pulse or a stray pulse can be taken for a valid one. In this case two images might get out of sync instead of just two lines. In practice this is suitable up to 90~120 lines. When the standard chosen matches the standard of transmission the image should appear in full size and proper aspect ratio. -All standards are supposed to work for any number of lines. You may experiment with any and see if it fits your purpose. However it will be easier to obtain good or optimal results in general with the following recommendations: +☞ All standards are supposed to work for any number of lines. You may experiment with any and see if it fits your purpose. However it will be easier to obtain good or optimal results in general with the following recommendations: @@ -167,19 +167,19 @@ All standards are supposed to work for any number of lines. You may experiment w - + - + - + - +
120ShNI, HLeapShNI, HSkip
90ShNI, HLeapShNI, HSkip
60HLeapHSkip
32HLeapHSkip
@@ -235,6 +235,8 @@ This is the length in time units of a horizontal or line synchronization pulse. Similarly to the line length slider the slider step is set to a sample period in order to ensure that the adjustment is done with the best possible precision. The middle position of the slider sets the nominal value and the slider step appears in the tooltip. +☞ You can move this control back and forth in case you have synchronizing issues as it can help the synchronization system to get back into pace. +

C: Image

Monitor

@@ -251,6 +253,6 @@ Select scope with the scope tab on the left side. ![ATV Demodulator plugin GUI Video scope](../../../doc/img/ATVDemod_pluginC_scope.png) -This is a scope widget fed with the video signal. Controls of the scope are the same as with the ChannelAnalyzerNG plugin. Please refer to the [source folder](https://github.com/f4exb/sdrangel/tree/master/plugins/channelrx/chanalyzerng) of this plugin for more details. +This is a scope widget fed with the video signal. Controls of the scope are the same as with the ChannelAnalyzerNG plugin. Please refer to [this plugin](https://github.com/f4exb/sdrangel/tree/master/plugins/channelrx/chanalyzerng) for more details. Note that the video signal is a real signal so the imaginary part is always null. Therefore only the "Real" mode for both the trace and the trigger is interesting. diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp index 81a73a735..49a37f7db 100644 --- a/plugins/channeltx/modatv/atvmod.cpp +++ b/plugins/channeltx/modatv/atvmod.cpp @@ -271,7 +271,7 @@ Complex& ATVMod::modulateVestigialSSB(Real& sample) void ATVMod::pullVideo(Real& sample) { - if ((m_running.m_atvStd == ATVStdHLeap) && (m_lineCount == m_nbLines2)) // last line in leap mode + if ((m_running.m_atvStd == ATVStdHSkip) && (m_lineCount == m_nbLines2)) // last line in skip mode { pullImageLine(sample, true); // pull image line without sync } @@ -829,7 +829,7 @@ void ATVMod::applyStandard() switch(m_config.m_atvStd) { - case ATVStdHLeap: + case ATVStdHSkip: m_nbImageLines = m_nbLines; // lines less the total number of sync lines m_nbImageLines2 = m_nbImageLines; // force non interleaved for vbars m_interleaved = false; diff --git a/plugins/channeltx/modatv/atvmod.h b/plugins/channeltx/modatv/atvmod.h index b866c5588..d9ec1d115 100644 --- a/plugins/channeltx/modatv/atvmod.h +++ b/plugins/channeltx/modatv/atvmod.h @@ -45,7 +45,7 @@ public: ATVStd405, ATVStdShortInterleaved, ATVStdShort, - ATVStdHLeap, + ATVStdHSkip, } ATVStd; typedef enum diff --git a/plugins/channeltx/modatv/atvmodgui.ui b/plugins/channeltx/modatv/atvmodgui.ui index aca23bd1c..d95e2c175 100644 --- a/plugins/channeltx/modatv/atvmodgui.ui +++ b/plugins/channeltx/modatv/atvmodgui.ui @@ -691,7 +691,7 @@ - HLeap + HSkip diff --git a/plugins/channeltx/modatv/readme.md b/plugins/channeltx/modatv/readme.md index e89e39e63..7587185c7 100644 --- a/plugins/channeltx/modatv/readme.md +++ b/plugins/channeltx/modatv/readme.md @@ -115,7 +115,56 @@ This controls the frame synchronization schem and number of black lines: - PAL405: this loosely corresponds to the British 405 lines system and is similar to PAL for synchronization. This mode has only 7 black lines. - ShI: this is an experimental mode that uses the least possible vertical sync lines as possible. That is one line for a long synchronization pulse and one line at a higher level (0.7) to reset the vertical sync condition. Thus only 2 lines are consumed for vertical sync and the rest is left to the image. In this mode the frames are interleaved - ShNI: this is the same as above but with non interleaved frames. - - HLeap: this is the horizontal sync leap technique for vertical synchronization. This has been in use in the first TV experiments with a small number of lines. This method just skips one horizontal synchronization pluse to mark the last or the first line (here it is the last). This method does not use any full line for vertical sync and all lines can be used for the image thus it suits the modes with a small number of lines. With more lines however the risk of missing pulses gets higher in adverse conditions because the pulses get shorter and may get swallowed by a stray pulse or a stray pulse can be taken for a valid one. In this case two images might get out of sync instead of just two lines. In practice this is suitable up to 90~120 lines. + - HSkip: this is the horizontal sync skip technique for vertical synchronization. This has been in use in the first TV experiments with a small number of lines. This method just skips one horizontal synchronization pluse to mark the last or the first line (here it is the last). This method does not use any full line for vertical sync and all lines can be used for the image thus it suits the modes with a small number of lines. With more lines however the risk of missing pulses gets higher in adverse conditions because the pulses get shorter and may get swallowed by a stray pulse or a stray pulse can be taken for a valid one. In this case two images might get out of sync instead of just two lines. In practice this is suitable up to 90~120 lines. + +☞ All standards are supposed to work for any number of lines. You may experiment with any and see if it fits your purpose. However it will be easier to obtain good or optimal results in general with the following recommendations: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#linesstandard
625PAL625, PAL525, PAL405
525PAL525, PAL405
405PAL405, ShI, ShNI
343ShI, ShNI
240ShNI
180ShNI
120ShNI, HSkip
90ShNI, HSkip
60HSkip
32HSkip

A.10: Input source

@@ -143,7 +192,7 @@ This button lets you adjust the luminance level of the "blank" screens displays, The button toggles the display of an overlay text on a still image, or a video signal from a file or a camera. Note that for still images you will have to toggle off/on this button to take any change of text or text brightness into account. The brightness level of the text is selected with the luminance adjust button (10). The number of characters is limited to 12. -The text area lers you type a text up to 12 characters. +The text area lets you type a text up to 12 characters.

6. Still picture file select