mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-30 20:40:20 -04:00 
			
		
		
		
	AM demod: implemented low pass filter after the demod
This commit is contained in:
		
							parent
							
								
									9bd9c805de
								
							
						
					
					
						commit
						d2c31059dd
					
				| @ -260,6 +260,10 @@ void AMDemod::processOneSample(Complex &ci) | ||||
|             demod = m_bandpass.filter(demod); | ||||
|             demod /= 301.0f; | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             demod = m_lowpass.filter(demod); | ||||
|         } | ||||
| 
 | ||||
|         Real attack = (m_squelchCount - 0.05f * m_audioSampleRate) / (0.05f * m_audioSampleRate); | ||||
|         sample = demod * StepFunctions::smootherstep(attack) * (m_audioSampleRate/24) * m_settings.m_volume; | ||||
| @ -383,6 +387,7 @@ void AMDemod::applyAudioSampleRate(int sampleRate) | ||||
|     m_interpolatorDistanceRemain = 0; | ||||
|     m_interpolatorDistance = (Real) m_inputSampleRate / (Real) sampleRate; | ||||
|     m_bandpass.create(301, sampleRate, 300.0, m_settings.m_rfBandwidth / 2.0f); | ||||
|     m_lowpass.create(301, sampleRate,  m_settings.m_rfBandwidth / 2.0f); | ||||
|     m_audioFifo.setSize(sampleRate); | ||||
|     m_squelchDelayLine.resize(sampleRate/5); | ||||
|     DSBFilter->create_dsb_filter((2.0f * m_settings.m_rfBandwidth) / (float) sampleRate); | ||||
| @ -456,6 +461,7 @@ void AMDemod::applySettings(const AMDemodSettings& settings, bool force) | ||||
|         m_interpolatorDistanceRemain = 0; | ||||
|         m_interpolatorDistance = (Real) m_inputSampleRate / (Real) m_audioSampleRate; | ||||
|         m_bandpass.create(301, m_audioSampleRate, 300.0, settings.m_rfBandwidth / 2.0f); | ||||
|         m_lowpass.create(301, m_audioSampleRate,  m_settings.m_rfBandwidth / 2.0f); | ||||
|         DSBFilter->create_dsb_filter((2.0f * settings.m_rfBandwidth) / (float) m_audioSampleRate); | ||||
|         m_settingsMutex.unlock(); | ||||
| 
 | ||||
|  | ||||
| @ -207,6 +207,7 @@ private: | ||||
| 	MovingAverageUtil<Real, double, 16> m_movingAverage; | ||||
| 	SimpleAGC<4800> m_volumeAGC; | ||||
|     Bandpass<Real> m_bandpass; | ||||
|     Lowpass<Real> m_lowpass; | ||||
|     Lowpass<std::complex<float> > m_pllFilt; | ||||
|     PhaseLockComplex m_pll; | ||||
|     fftfilt* DSBFilter; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user