-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ATV Demodulator: arbitrary sample rate support #594
Comments
Yes it has quite a few side effects but much towards simplification. I can do that part. |
Important improvement is reduced CPU usage in case of "not round" (don't know how to call it) sample rate. |
Yes my plan is to remove the rational down-sampler and its software FIR filter. Moreover this did not yield good results for non integer ratios (so pretty useless outside of filtering). With the bandwidths usually implied the hardware filtering is enough to get rid of unwanted out of band signals. Some devices like the LimeSDR also have a FIR filter implemented in hardware. I will keep the FFT filter as an option for corner cases but this is indeed an option. |
I completely agree with this (remove of decimator(?) and keeping FFT). |
I have found a little bug in my hackfix:
With disabled HSync m_hSyncShift just will be zero.
|
Overall I like recent changes. But I think that some corrections are needed for m_settings changesdiff --git a/plugins/channelrx/demodatv/atvdemodsink.cpp b/plugins/channelrx/demodatv/atvdemodsink.cpp
index 6d031d327..0f51d1a92 100644
--- a/plugins/channelrx/demodatv/atvdemodsink.cpp
+++ b/plugins/channelrx/demodatv/atvdemodsink.cpp
@@ -515,21 +515,22 @@ void ATVDemodSink::applySettings(const ATVDemodSettings& settings, bool force)
unsigned int samplesPerLineNom;
ATVDemodSettings::getBaseValues(m_channelSampleRate, settings.m_nbLines * settings.m_fps, samplesPerLineNom);
m_samplesPerLine = samplesPerLineNom;
- m_samplesPerLineFrac = (float)m_channelSampleRate / (m_settings.m_nbLines * m_settings.m_fps) - m_samplesPerLine;
- m_ampAverage.resize(m_samplesPerLine * m_settings.m_nbLines * 2); // AGC average in two full images
+ m_samplesPerLineFrac = (float)m_channelSampleRate / (settings.m_nbLines * settings.m_fps) - m_samplesPerLine;
+ m_ampAverage.resize(m_samplesPerLine * settings.m_nbLines * 2); // AGC average in two full images
qDebug() << "ATVDemodSink::applySettings:"
<< " m_channelSampleRate: " << m_channelSampleRate
<< " m_samplesPerLine:" << m_samplesPerLine
<< " m_samplesPerLineFrac:" << m_samplesPerLineFrac;
- applyStandard(m_channelSampleRate, settings.m_atvStd, ATVDemodSettings::getNominalLineTime(settings.m_nbLines, settings.m_fps));
+ applyStandard(m_channelSampleRate, settings.m_atvStd,
+ ATVDemodSettings::getNominalLineTime(settings.m_nbLines, settings.m_fps));
if (m_registeredTVScreen)
{
m_registeredTVScreen->resizeTVScreen(
m_samplesPerLine - m_numberSamplesPerLineSignals,
- m_settings.m_nbLines - m_numberOfBlackLines
+ settings.m_nbLines - m_numberOfBlackLines
);
m_tvScreenBuffer = m_registeredTVScreen->getBackBuffer();
} I have uploaded |
Thanks for spotting this. I had noticed the issue but wasn't able to spot it although it is pretty obvious when you see it. A second pair of eyes is always useful. |
Implemented in v4.15.1 |
Present state of ATV Demodulator allows enabling of arbitrary sample rate support with minimal changes to the code.
Here is the hack (which is not intended for merging), which shows needed changes: Vort@d089307.
With this change,
hacktv_dec2.sdriq
decodes properly.Despite ease of enabling, much work is needed to do this properly.
Lots of existing code expects sample rate to be limited.
There are
ATVDemodSettings::getBaseValues
code, which calculate correct amounts of points per line;m_interpolator
, which converts samplerates; lots of documentation about selecting proper sample rate.All these things should be changed or at least reconsidered.
And since it is architectural changes, they are better to be done by @f4exb.
The text was updated successfully, but these errors were encountered: