kopia lustrzana https://github.com/f4exb/sdrangel
				
				
				
			Spectrum frequency zoom: Restrict autoscale to visible spectrum area. Added missing images for documentation. Issue #773
							rodzic
							
								
									7ea71996f0
								
							
						
					
					
						commit
						a8bba2e95a
					
				
										
											Plik binarny nie jest wyświetlany.
										
									
								
							| Po Szerokość: | Wysokość: | Rozmiar: 2.5 KiB | 
										
											Plik binarny nie jest wyświetlany.
										
									
								
							|  | @ -683,6 +683,15 @@ void SpectrumVis::feed(const SampleVector::const_iterator& cbegin, const SampleV | ||||||
| 	 m_mutex.unlock(); | 	 m_mutex.unlock(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void SpectrumVis::getZoomedPSDCopy(std::vector<Real>& copy) const | ||||||
|  | { | ||||||
|  |     int fftMin = (m_frequencyZoomFactor == 1.0f) ? | ||||||
|  |         0 : (m_frequencyZoomPos - (0.5f / m_frequencyZoomFactor)) * m_settings.m_fftSize; | ||||||
|  |     int fftMax = (m_frequencyZoomFactor == 1.0f) ? | ||||||
|  |         m_settings.m_fftSize : (m_frequencyZoomPos + (0.5f / m_frequencyZoomFactor)) * m_settings.m_fftSize; | ||||||
|  |     copy.assign(m_psd.begin() + fftMin, m_psd.begin() + fftMax); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void SpectrumVis::start() | void SpectrumVis::start() | ||||||
| { | { | ||||||
|     setRunning(true); |     setRunning(true); | ||||||
|  |  | ||||||
|  | @ -147,7 +147,8 @@ public: | ||||||
|     const GLSpectrumSettings& getSettings() const { return m_settings; } |     const GLSpectrumSettings& getSettings() const { return m_settings; } | ||||||
|     Real getSpecMax() const { return m_specMax / m_powFFTDiv; } |     Real getSpecMax() const { return m_specMax / m_powFFTDiv; } | ||||||
|     void getPowerSpectrumCopy(std::vector<Real>& copy) { copy.assign(m_powerSpectrum.begin(), m_powerSpectrum.end()); } |     void getPowerSpectrumCopy(std::vector<Real>& copy) { copy.assign(m_powerSpectrum.begin(), m_powerSpectrum.end()); } | ||||||
|     void getPSDCopy(std::vector<Real>& copy) { copy.assign(m_psd.begin(), m_psd.begin() + m_settings.m_fftSize); } |     void getPSDCopy(std::vector<Real>& copy) const { copy.assign(m_psd.begin(), m_psd.begin() + m_settings.m_fftSize); } | ||||||
|  |     void getZoomedPSDCopy(std::vector<Real>& copy) const; | ||||||
| 
 | 
 | ||||||
| 	virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly); | 	virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly); | ||||||
|     virtual void feed(const Complex *begin, unsigned int length); //!< direct FFT feed
 |     virtual void feed(const Complex *begin, unsigned int length); //!< direct FFT feed
 | ||||||
|  |  | ||||||
|  | @ -267,7 +267,7 @@ void GLSpectrumGUI::on_autoscale_clicked(bool checked) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     std::vector<Real> psd; |     std::vector<Real> psd; | ||||||
|     m_spectrumVis->getPSDCopy(psd); |     m_spectrumVis->getZoomedPSDCopy(psd); | ||||||
|     int avgRange = m_settings.m_fftSize / 32; |     int avgRange = m_settings.m_fftSize / 32; | ||||||
| 
 | 
 | ||||||
|     if (psd.size() < (unsigned int) avgRange) { |     if (psd.size() < (unsigned int) avgRange) { | ||||||
|  |  | ||||||
		Ładowanie…
	
		Reference in New Issue
	
	 f4exb
						f4exb