SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
|
#include <spectrumvis.h>
Classes | |
class | MsgConfigureSpectrumVis |
Public Types | |
enum | AvgMode { AvgModeNone, AvgModeMovingAvg, AvgModeFixedAvg, AvgModeMax } |
Public Member Functions | |
SpectrumVis (Real scalef, GLSpectrum *glSpectrum=0) | |
virtual | ~SpectrumVis () |
void | configure (MessageQueue *msgQueue, int fftSize, int overlapPercent, unsigned int averagingNb, int averagingMode, FFTWindow::Function window, bool m_linear) |
virtual void | feed (const SampleVector::const_iterator &begin, const SampleVector::const_iterator &end, bool positiveOnly) |
void | feedTriggered (const SampleVector::const_iterator &triggerPoint, const SampleVector::const_iterator &end, bool positiveOnly) |
virtual void | start () |
virtual void | stop () |
virtual bool | handleMessage (const Message &message) |
Processing of a message. Returns true if message has actually been processed. More... | |
Public Member Functions inherited from BasebandSampleSink | |
BasebandSampleSink () | |
virtual | ~BasebandSampleSink () |
MessageQueue * | getInputMessageQueue () |
Get the queue for asynchronous inbound communication. More... | |
virtual void | setMessageQueueToGUI (MessageQueue *queue) |
MessageQueue * | getMessageQueueToGUI () |
Private Member Functions | |
void | handleConfigure (int fftSize, int overlapPercent, unsigned int averageNb, AvgMode averagingMode, FFTWindow::Function window, bool linear) |
Private Attributes | |
FFTEngine * | m_fft |
FFTWindow | m_window |
std::vector< Complex > | m_fftBuffer |
std::vector< Real > | m_powerSpectrum |
std::size_t | m_fftSize |
std::size_t | m_overlapPercent |
std::size_t | m_overlapSize |
std::size_t | m_refillSize |
std::size_t | m_fftBufferFill |
bool | m_needMoreSamples |
Real | m_scalef |
GLSpectrum * | m_glSpectrum |
MovingAverage2D< double > | m_movingAverage |
FixedAverage2D< double > | m_fixedAverage |
Max2D< double > | m_max |
unsigned int | m_averageNb |
AvgMode | m_avgMode |
bool | m_linear |
Real | m_ofs |
Real | m_powFFTDiv |
QMutex | m_mutex |
Static Private Attributes | |
static const Real | m_mult = (10.0f / log2f(10.0f)) |
Additional Inherited Members | |
Protected Slots inherited from BasebandSampleSink | |
void | handleInputMessages () |
Protected Attributes inherited from BasebandSampleSink | |
MessageQueue | m_inputMessageQueue |
Queue for asynchronous inbound communication. More... | |
MessageQueue * | m_guiMessageQueue |
Input message queue to the GUI. More... | |
Definition at line 17 of file spectrumvis.h.
enum SpectrumVis::AvgMode |
Enumerator | |
---|---|
AvgModeNone | |
AvgModeMovingAvg | |
AvgModeFixedAvg | |
AvgModeMax |
Definition at line 20 of file spectrumvis.h.
SpectrumVis::SpectrumVis | ( | Real | scalef, |
GLSpectrum * | glSpectrum = 0 |
||
) |
Definition at line 19 of file spectrumvis.cpp.
References AvgModeNone, FFTWindow::BlackmanHarris, and handleConfigure().
|
virtual |
Definition at line 39 of file spectrumvis.cpp.
References m_fft.
void SpectrumVis::configure | ( | MessageQueue * | msgQueue, |
int | fftSize, | ||
int | overlapPercent, | ||
unsigned int | averagingNb, | ||
int | averagingMode, | ||
FFTWindow::Function | window, | ||
bool | m_linear | ||
) |
Definition at line 44 of file spectrumvis.cpp.
References MessageQueue::push().
Referenced by GLSpectrumGUI::applySettings(), BFMDemodGUI::BFMDemodGUI(), GLSpectrumGUI::on_averaging_currentIndexChanged(), GLSpectrumGUI::on_averagingMode_currentIndexChanged(), GLSpectrumGUI::on_fftSize_currentIndexChanged(), GLSpectrumGUI::on_fftWindow_currentIndexChanged(), GLSpectrumGUI::on_linscale_toggled(), UDPSinkGUI::UDPSinkGUI(), and UDPSourceGUI::UDPSourceGUI().
|
virtual |
Implements BasebandSampleSink.
Definition at line 77 of file spectrumvis.cpp.
References FFTWindow::apply(), AvgModeFixedAvg, AvgModeMax, AvgModeMovingAvg, AvgModeNone, i, FFTEngine::in(), log2f(), m_avgMode, m_fft, m_fftBuffer, m_fftBufferFill, m_fftSize, m_fixedAverage, m_glSpectrum, m_linear, m_max, m_movingAverage, m_mult, m_mutex, m_needMoreSamples, m_ofs, m_overlapSize, m_powerSpectrum, m_powFFTDiv, m_refillSize, m_scalef, m_window, leansdr::max(), GLSpectrum::newSpectrum(), FixedAverage2D< T >::nextAverage(), MovingAverage2D< T >::nextAverage(), Max2D< T >::nextMax(), FFTEngine::out(), FixedAverage2D< T >::storeAndGetAvg(), MovingAverage2D< T >::storeAndGetAvg(), Max2D< T >::storeAndGetMax(), and FFTEngine::transform().
Referenced by feedTriggered().
void SpectrumVis::feedTriggered | ( | const SampleVector::const_iterator & | triggerPoint, |
const SampleVector::const_iterator & | end, | ||
bool | positiveOnly | ||
) |
Definition at line 56 of file spectrumvis.cpp.
References feed().
Referenced by SpectrumScopeComboVis::feed().
|
private |
Definition at line 331 of file spectrumvis.cpp.
References FFTEngine::configure(), FFTWindow::create(), m_averageNb, m_avgMode, m_fft, m_fftBufferFill, m_fftSize, m_fixedAverage, m_linear, m_max, m_movingAverage, m_mutex, m_ofs, m_overlapPercent, m_overlapSize, m_powFFTDiv, m_refillSize, m_window, MAX_FFT_SIZE, Max2D< T >::resize(), FixedAverage2D< T >::resize(), and MovingAverage2D< T >::resize().
Referenced by handleMessage(), and SpectrumVis().
|
virtual |
Processing of a message. Returns true if message has actually been processed.
Implements BasebandSampleSink.
Definition at line 312 of file spectrumvis.cpp.
References SpectrumVis::MsgConfigureSpectrumVis::getAverageNb(), SpectrumVis::MsgConfigureSpectrumVis::getAvgMode(), SpectrumVis::MsgConfigureSpectrumVis::getFFTSize(), SpectrumVis::MsgConfigureSpectrumVis::getLinear(), SpectrumVis::MsgConfigureSpectrumVis::getOverlapPercent(), SpectrumVis::MsgConfigureSpectrumVis::getWindow(), handleConfigure(), and Message::match().
Referenced by SpectrumScopeComboVis::handleMessage().
|
virtual |
Implements BasebandSampleSink.
Definition at line 304 of file spectrumvis.cpp.
Referenced by SpectrumScopeComboVis::start().
|
virtual |
Implements BasebandSampleSink.
Definition at line 308 of file spectrumvis.cpp.
Referenced by SpectrumScopeComboVis::stop().
|
private |
Definition at line 101 of file spectrumvis.h.
Referenced by handleConfigure().
|
private |
Definition at line 102 of file spectrumvis.h.
Referenced by feed(), and handleConfigure().
|
private |
Definition at line 83 of file spectrumvis.h.
Referenced by feed(), handleConfigure(), and ~SpectrumVis().
|
private |
Definition at line 86 of file spectrumvis.h.
Referenced by feed().
|
private |
Definition at line 93 of file spectrumvis.h.
Referenced by feed(), and handleConfigure().
|
private |
Definition at line 89 of file spectrumvis.h.
Referenced by feed(), and handleConfigure().
|
private |
Definition at line 99 of file spectrumvis.h.
Referenced by feed(), and handleConfigure().
|
private |
Definition at line 97 of file spectrumvis.h.
Referenced by feed().
|
private |
Definition at line 103 of file spectrumvis.h.
Referenced by feed(), and handleConfigure().
|
private |
Definition at line 100 of file spectrumvis.h.
Referenced by feed(), and handleConfigure().
|
private |
Definition at line 98 of file spectrumvis.h.
Referenced by feed(), and handleConfigure().
|
staticprivate |
Definition at line 107 of file spectrumvis.h.
|
private |
Definition at line 109 of file spectrumvis.h.
Referenced by feed(), and handleConfigure().
|
private |
Definition at line 94 of file spectrumvis.h.
Referenced by feed().
|
private |
Definition at line 105 of file spectrumvis.h.
Referenced by feed(), and handleConfigure().
|
private |
Definition at line 90 of file spectrumvis.h.
Referenced by handleConfigure().
|
private |
Definition at line 91 of file spectrumvis.h.
Referenced by feed(), and handleConfigure().
|
private |
Definition at line 87 of file spectrumvis.h.
Referenced by feed().
|
private |
Definition at line 106 of file spectrumvis.h.
Referenced by feed(), and handleConfigure().
|
private |
Definition at line 92 of file spectrumvis.h.
Referenced by feed(), and handleConfigure().
|
private |
Definition at line 96 of file spectrumvis.h.
Referenced by feed().
|
private |
Definition at line 84 of file spectrumvis.h.
Referenced by feed(), and handleConfigure().