mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-31 13:00:26 -04:00 
			
		
		
		
	DSD Demod: use same magnitude squared average technique for the squelch as with the NFM demod
This commit is contained in:
		
							parent
							
								
									db3375ca3e
								
							
						
					
					
						commit
						dad2bf7bf9
					
				| @ -67,7 +67,7 @@ DSDDemod::DSDDemod(BasebandSampleSink* sampleSink) : | |||||||
| 	m_sampleBuffer = new qint16[1<<17]; // 128 kS
 | 	m_sampleBuffer = new qint16[1<<17]; // 128 kS
 | ||||||
| 	m_sampleBufferIndex = 0; | 	m_sampleBufferIndex = 0; | ||||||
| 
 | 
 | ||||||
| //    m_movingAverage.resize(50, 0);
 |     m_movingAverage.resize(16, 0); | ||||||
| 	m_magsq = 0.0f; | 	m_magsq = 0.0f; | ||||||
|     m_magsqSum = 0.0f; |     m_magsqSum = 0.0f; | ||||||
|     m_magsqPeak = 0.0f; |     m_magsqPeak = 0.0f; | ||||||
| @ -141,7 +141,7 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto | |||||||
|             qint16 sample, delayedSample; |             qint16 sample, delayedSample; | ||||||
| 
 | 
 | ||||||
|             Real magsq = ((ci.real()*ci.real() +  ci.imag()*ci.imag()))  / (1<<30); |             Real magsq = ((ci.real()*ci.real() +  ci.imag()*ci.imag()))  / (1<<30); | ||||||
| //            m_movingAverage.feed(m_magsq);
 |             m_movingAverage.feed(magsq); | ||||||
| 
 | 
 | ||||||
|             m_magsqSum += magsq; |             m_magsqSum += magsq; | ||||||
| 
 | 
 | ||||||
| @ -157,7 +157,7 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto | |||||||
| 
 | 
 | ||||||
|             // AF processing
 |             // AF processing
 | ||||||
| 
 | 
 | ||||||
|             if (getMagSq() > m_squelchLevel) |             if (m_movingAverage.average() > m_squelchLevel) | ||||||
|             { |             { | ||||||
|                 if (m_squelchGate > 0) |                 if (m_squelchGate > 0) | ||||||
|                 { |                 { | ||||||
|  | |||||||
| @ -262,7 +262,7 @@ private: | |||||||
| 	bool m_squelchOpen; | 	bool m_squelchOpen; | ||||||
| 
 | 
 | ||||||
| 	Real m_lastArgument; | 	Real m_lastArgument; | ||||||
| //    MovingAverage<double> m_movingAverage;
 |     MovingAverage<Real> m_movingAverage; | ||||||
|     Real m_magsq; |     Real m_magsq; | ||||||
|     Real m_magsqSum; |     Real m_magsqSum; | ||||||
|     Real m_magsqPeak; |     Real m_magsqPeak; | ||||||
|  | |||||||
| @ -24,7 +24,7 @@ | |||||||
| 
 | 
 | ||||||
| const PluginDescriptor DSDDemodPlugin::m_pluginDescriptor = { | const PluginDescriptor DSDDemodPlugin::m_pluginDescriptor = { | ||||||
| 	QString("DSD Demodulator"), | 	QString("DSD Demodulator"), | ||||||
| 	QString("2.1.5"), | 	QString("2.5.0"), | ||||||
| 	QString("(c) Edouard Griffiths, F4EXB"), | 	QString("(c) Edouard Griffiths, F4EXB"), | ||||||
| 	QString("https://github.com/f4exb/sdrangel"), | 	QString("https://github.com/f4exb/sdrangel"), | ||||||
| 	true, | 	true, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user