raDIYo 0.4
SWFFTCalc Class Reference
Inheritance diagram for SWFFTCalc:

Signals

void spectrumReady (const SWDoubleVec &spectrum)
 

Public Member Functions

 SWFFTCalc (QObject *parent=nullptr)
 
void collectFrames (QAudioBuffer &audiobuffer)
 Track::getPeakValue. More...
 

Protected Types

typedef std::complex< double > Complex
 
typedef std::valarray< Complex > CArray
 

Protected Member Functions

void bareFFT (CArray &x)
 

Protected Attributes

const double PI = 3.141592653589793238460
 
const qreal SpectrumAnalyserMultiplier = 0.10
 
QAudioBuffer::S32F _s32f
 
QAudioBuffer::S16S _s16s
 
QAudioBuffer::S16U _s16u
 
QAudioBuffer::S8S _s8s
 
QAudioBuffer::S8U _s8u
 
int _bufferDuration = 0
 
QElapsedTimer _timer
 
SWDoubleVec _frames
 
SWDoubleVec _hannWindow
 
SWDoubleVec _spectrum
 
CArray _complexFrame
 

Static Protected Attributes

static constexpr const int SWNUMSAMPLES = 4096
 

Detailed Description

Definition at line 35 of file swfftcalc.h.

Member Typedef Documentation

◆ CArray

typedef std::valarray<Complex> SWFFTCalc::CArray
protected

Definition at line 54 of file swfftcalc.h.

◆ Complex

typedef std::complex<double> SWFFTCalc::Complex
protected

Definition at line 53 of file swfftcalc.h.

Constructor & Destructor Documentation

◆ SWFFTCalc()

SWFFTCalc::SWFFTCalc ( QObject *  parent = nullptr)
explicit

Definition at line 34 of file swfftcalc.cpp.

◆ ~SWFFTCalc()

SWFFTCalc::~SWFFTCalc ( )
virtual

Definition at line 92 of file swfftcalc.cpp.

Member Function Documentation

◆ bareFFT()

void SWFFTCalc::bareFFT ( CArray &  x)
protected

Definition at line 216 of file swfftcalc.cpp.

◆ collectFrames()

void SWFFTCalc::collectFrames ( QAudioBuffer &  audiobuffer)

Track::getPeakValue.

https://stackoverflow.com/questions/46947668/draw-waveform-from-raw-data-using-qaudioprobe

Parameters
format
Returns
The peak value

Definition at line 120 of file swfftcalc.cpp.

Member Data Documentation

◆ _bufferDuration

int SWFFTCalc::_bufferDuration = 0
protected

Definition at line 82 of file swfftcalc.h.

◆ _complexFrame

CArray SWFFTCalc::_complexFrame
protected

Definition at line 89 of file swfftcalc.h.

◆ _frames

SWDoubleVec SWFFTCalc::_frames
protected

Definition at line 84 of file swfftcalc.h.

◆ _hannWindow

SWDoubleVec SWFFTCalc::_hannWindow
protected

Definition at line 85 of file swfftcalc.h.

◆ _s16s

QAudioBuffer::S16S SWFFTCalc::_s16s
protected

Definition at line 69 of file swfftcalc.h.

◆ _s16u

QAudioBuffer::S16U SWFFTCalc::_s16u
protected

Definition at line 70 of file swfftcalc.h.

◆ _s32f

QAudioBuffer::S32F SWFFTCalc::_s32f
protected

Definition at line 68 of file swfftcalc.h.

◆ _s8s

QAudioBuffer::S8S SWFFTCalc::_s8s
protected

Definition at line 71 of file swfftcalc.h.

◆ _s8u

QAudioBuffer::S8U SWFFTCalc::_s8u
protected

Definition at line 72 of file swfftcalc.h.

◆ _spectrum

SWDoubleVec SWFFTCalc::_spectrum
protected

Definition at line 88 of file swfftcalc.h.

◆ _timer

QElapsedTimer SWFFTCalc::_timer
protected

Definition at line 83 of file swfftcalc.h.

◆ PI

const double SWFFTCalc::PI = 3.141592653589793238460
protected

Definition at line 62 of file swfftcalc.h.

◆ SpectrumAnalyserMultiplier

const qreal SWFFTCalc::SpectrumAnalyserMultiplier = 0.10
protected

Definition at line 66 of file swfftcalc.h.

◆ SWNUMSAMPLES

constexpr const int SWFFTCalc::SWNUMSAMPLES = 4096
staticconstexprprotected

Definition at line 61 of file swfftcalc.h.


The documentation for this class was generated from the following files: