mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-11-03 13:11:20 -05:00 
			
		
		
		
	ATV Demod: effectively implemented interpolator
This commit is contained in:
		
							parent
							
								
									93a45e88f5
								
							
						
					
					
						commit
						4c983abd0b
					
				@ -193,13 +193,13 @@ void ATVDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
        Complex c(fltI, fltQ);
 | 
					        Complex c(fltI, fltQ);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (m_objRFRunning.m_intFrequencyOffset != 0)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            c *= m_nco.nextIQ();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (m_objRFRunning.m_blndecimatorEnable)
 | 
					        if (m_objRFRunning.m_blndecimatorEnable)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					            if (m_objRFRunning.m_intFrequencyOffset != 0)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                c *= m_nco.nextIQ();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (m_interpolator.decimate(&m_interpolatorDistanceRemain, c, &ci))
 | 
					            if (m_interpolator.decimate(&m_interpolatorDistanceRemain, c, &ci))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                demod(ci);
 | 
					                demod(ci);
 | 
				
			||||||
@ -595,6 +595,7 @@ void ATVDemod::applySettings()
 | 
				
			|||||||
    if ((m_objConfig.m_intSampleRate != m_objRunning.m_intSampleRate)
 | 
					    if ((m_objConfig.m_intSampleRate != m_objRunning.m_intSampleRate)
 | 
				
			||||||
        || (m_objRFConfig.m_fltRFBandwidth != m_objRFRunning.m_fltRFBandwidth))
 | 
					        || (m_objRFConfig.m_fltRFBandwidth != m_objRFRunning.m_fltRFBandwidth))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        m_objSettingsMutex.lock();
 | 
				
			||||||
        m_intTVSampleRate = (m_objConfig.m_intSampleRate / 1000000) * 1000000; // make sure working sample rate is a multiple of rate units
 | 
					        m_intTVSampleRate = (m_objConfig.m_intSampleRate / 1000000) * 1000000; // make sure working sample rate is a multiple of rate units
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (m_intTVSampleRate > 0)
 | 
					        if (m_intTVSampleRate > 0)
 | 
				
			||||||
@ -604,12 +605,12 @@ void ATVDemod::applySettings()
 | 
				
			|||||||
        else
 | 
					        else
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            m_intTVSampleRate = m_objConfig.m_intSampleRate;
 | 
					            m_intTVSampleRate = m_objConfig.m_intSampleRate;
 | 
				
			||||||
            m_interpolatorDistanceRemain = 0;
 | 
					 | 
				
			||||||
            m_interpolatorDistance = 1.0f;
 | 
					            m_interpolatorDistance = 1.0f;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        m_interpolatorDistanceRemain = 0;
 | 
					        m_interpolatorDistanceRemain = 0;
 | 
				
			||||||
        m_interpolator.create(48, m_intTVSampleRate, m_objRFConfig.m_fltRFBandwidth / 2.2, 3.0);
 | 
					        m_interpolator.create(48, m_intTVSampleRate, m_objRFConfig.m_fltRFBandwidth / 2.2, 3.0);
 | 
				
			||||||
 | 
					        m_objSettingsMutex.unlock();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if((m_objConfig.m_fltFramePerS != m_objRunning.m_fltFramePerS)
 | 
					    if((m_objConfig.m_fltFramePerS != m_objRunning.m_fltFramePerS)
 | 
				
			||||||
 | 
				
			|||||||
@ -213,6 +213,7 @@ private:
 | 
				
			|||||||
                m_objMsgConfig.m_fltRFBandwidth = fltRFBandwidth;
 | 
					                m_objMsgConfig.m_fltRFBandwidth = fltRFBandwidth;
 | 
				
			||||||
                m_objMsgConfig.m_fltRFOppBandwidth = fltRFOppBandwidth;
 | 
					                m_objMsgConfig.m_fltRFOppBandwidth = fltRFOppBandwidth;
 | 
				
			||||||
                m_objMsgConfig.m_blnFFTFiltering = blnFFTFiltering;
 | 
					                m_objMsgConfig.m_blnFFTFiltering = blnFFTFiltering;
 | 
				
			||||||
 | 
					                m_objMsgConfig.m_blndecimatorEnable = blndecimatorEnable;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -361,7 +361,7 @@ void ATVDemodGUI::applyRFSettings()
 | 
				
			|||||||
                ui->rfBW->value() * 100000.0f,
 | 
					                ui->rfBW->value() * 100000.0f,
 | 
				
			||||||
                ui->rfOppBW->value() * 100000.0f,
 | 
					                ui->rfOppBW->value() * 100000.0f,
 | 
				
			||||||
                ui->rfFiltering->isChecked(),
 | 
					                ui->rfFiltering->isChecked(),
 | 
				
			||||||
                ui->decimator->isChecked());
 | 
					                ui->decimatorEnable->isChecked());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -490,6 +490,7 @@ void ATVDemodGUI::on_modulation_currentIndexChanged(int index)
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					            m_objChannelMarker.setBandwidth(ui->rfBW->value()*100000);
 | 
				
			||||||
            m_objChannelMarker.setSidebands(ChannelMarker::dsb);
 | 
					            m_objChannelMarker.setSidebands(ChannelMarker::dsb);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -565,6 +566,7 @@ void ATVDemodGUI::on_rfFiltering_toggled(bool checked)
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					            m_objChannelMarker.setOppositeBandwidth(ui->rfOppBW->value()*100000);
 | 
				
			||||||
            m_objChannelMarker.setSidebands(ChannelMarker::dsb);
 | 
					            m_objChannelMarker.setSidebands(ChannelMarker::dsb);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -578,7 +580,7 @@ void ATVDemodGUI::on_rfFiltering_toggled(bool checked)
 | 
				
			|||||||
    applyRFSettings();
 | 
					    applyRFSettings();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ATVDemodGUI::on_decimator_toggled(bool checked)
 | 
					void ATVDemodGUI::on_decimatorEnable_toggled(bool checked)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    applyRFSettings();
 | 
					    applyRFSettings();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -75,7 +75,7 @@ private slots:
 | 
				
			|||||||
    void on_rfBW_valueChanged(int value);
 | 
					    void on_rfBW_valueChanged(int value);
 | 
				
			||||||
    void on_rfOppBW_valueChanged(int value);
 | 
					    void on_rfOppBW_valueChanged(int value);
 | 
				
			||||||
    void on_rfFiltering_toggled(bool checked);
 | 
					    void on_rfFiltering_toggled(bool checked);
 | 
				
			||||||
    void on_decimator_toggled(bool checked);
 | 
					    void on_decimatorEnable_toggled(bool checked);
 | 
				
			||||||
    void on_deltaFrequency_changed(quint64 value);
 | 
					    void on_deltaFrequency_changed(quint64 value);
 | 
				
			||||||
    void on_deltaFrequencyMinus_toggled(bool minus);
 | 
					    void on_deltaFrequencyMinus_toggled(bool minus);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -52,6 +52,20 @@
 | 
				
			|||||||
    </property>
 | 
					    </property>
 | 
				
			||||||
    <item>
 | 
					    <item>
 | 
				
			||||||
     <layout class="QHBoxLayout" name="rfSettings1Layout">
 | 
					     <layout class="QHBoxLayout" name="rfSettings1Layout">
 | 
				
			||||||
 | 
					      <item>
 | 
				
			||||||
 | 
					       <widget class="ButtonSwitch" name="decimatorEnable">
 | 
				
			||||||
 | 
					        <property name="text">
 | 
				
			||||||
 | 
					         <string/>
 | 
				
			||||||
 | 
					        </property>
 | 
				
			||||||
 | 
					        <property name="icon">
 | 
				
			||||||
 | 
					         <iconset resource="../../../sdrbase/resources/res.qrc">
 | 
				
			||||||
 | 
					          <normaloff>:/arrow_down.png</normaloff>:/arrow_down.png</iconset>
 | 
				
			||||||
 | 
					        </property>
 | 
				
			||||||
 | 
					        <property name="checkable">
 | 
				
			||||||
 | 
					         <bool>true</bool>
 | 
				
			||||||
 | 
					        </property>
 | 
				
			||||||
 | 
					       </widget>
 | 
				
			||||||
 | 
					      </item>
 | 
				
			||||||
      <item>
 | 
					      <item>
 | 
				
			||||||
       <layout class="QHBoxLayout" name="deltaFrequencyLayout">
 | 
					       <layout class="QHBoxLayout" name="deltaFrequencyLayout">
 | 
				
			||||||
        <item>
 | 
					        <item>
 | 
				
			||||||
@ -65,6 +79,9 @@
 | 
				
			|||||||
            <selectedon>:/minus.png</selectedon>
 | 
					            <selectedon>:/minus.png</selectedon>
 | 
				
			||||||
           </iconset>
 | 
					           </iconset>
 | 
				
			||||||
          </property>
 | 
					          </property>
 | 
				
			||||||
 | 
					          <property name="checkable">
 | 
				
			||||||
 | 
					           <bool>true</bool>
 | 
				
			||||||
 | 
					          </property>
 | 
				
			||||||
         </widget>
 | 
					         </widget>
 | 
				
			||||||
        </item>
 | 
					        </item>
 | 
				
			||||||
        <item>
 | 
					        <item>
 | 
				
			||||||
@ -98,20 +115,6 @@
 | 
				
			|||||||
        </item>
 | 
					        </item>
 | 
				
			||||||
       </layout>
 | 
					       </layout>
 | 
				
			||||||
      </item>
 | 
					      </item>
 | 
				
			||||||
      <item>
 | 
					 | 
				
			||||||
       <widget class="ButtonSwitch" name="decimator">
 | 
					 | 
				
			||||||
        <property name="text">
 | 
					 | 
				
			||||||
         <string/>
 | 
					 | 
				
			||||||
        </property>
 | 
					 | 
				
			||||||
        <property name="icon">
 | 
					 | 
				
			||||||
         <iconset resource="../../../sdrbase/resources/res.qrc">
 | 
					 | 
				
			||||||
          <normaloff>:/arrow_down.png</normaloff>:/arrow_down.png</iconset>
 | 
					 | 
				
			||||||
        </property>
 | 
					 | 
				
			||||||
        <property name="checkable">
 | 
					 | 
				
			||||||
         <bool>true</bool>
 | 
					 | 
				
			||||||
        </property>
 | 
					 | 
				
			||||||
       </widget>
 | 
					 | 
				
			||||||
      </item>
 | 
					 | 
				
			||||||
      <item>
 | 
					      <item>
 | 
				
			||||||
       <widget class="QLabel" name="channelSampleRateText">
 | 
					       <widget class="QLabel" name="channelSampleRateText">
 | 
				
			||||||
        <property name="minimumSize">
 | 
					        <property name="minimumSize">
 | 
				
			||||||
@ -195,6 +198,9 @@
 | 
				
			|||||||
     <layout class="QHBoxLayout" name="rfSettings2Layout">
 | 
					     <layout class="QHBoxLayout" name="rfSettings2Layout">
 | 
				
			||||||
      <item>
 | 
					      <item>
 | 
				
			||||||
       <widget class="ButtonSwitch" name="rfFiltering">
 | 
					       <widget class="ButtonSwitch" name="rfFiltering">
 | 
				
			||||||
 | 
					        <property name="toolTip">
 | 
				
			||||||
 | 
					         <string>Engage asymmertical bandpass FFT filter</string>
 | 
				
			||||||
 | 
					        </property>
 | 
				
			||||||
        <property name="text">
 | 
					        <property name="text">
 | 
				
			||||||
         <string/>
 | 
					         <string/>
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user