Spectrum Example

Analyzing a raw audio stream using the FFTReal library

Analyzing a raw audio stream using the FFTReal library.

Spectrum demonstrates how the Qt Multimedia module can be used to analyze an audio stream while recording it, and also play the recorded stream.

Because Qt Multimedia allows the application to access the raw audio stream, the data can either be inspected or modified by the application. The Spectrum Analyzer example displays three pieces of information while audio is being either captured or played back:

  • A representation of the frequency spectrum, shown at the lower left

  • The current RMS level of the audio stream, and the recent ‘high watermark’ level, shown at the lower right

Spectrum analysis is performed by calculating the Fast Fourier Transform (FFT) of a segment of audio data. An open-source library, FFTReal, against which the application is dynamically linked, is used to compute the transform.

Running the Example

To run the example from Qt Creator , open the Welcome mode and select the example from Examples . For more information, visit Building and Running an Example.

Array.h Example File

DynArray.h Example File

FFTReal.h Example File

FFTRealFixLen.h Example File

FFTRealFixLenParam.h Example File

FFTRealPassDirect.h Example File

FFTRealPassInverse.h Example File

FFTRealSelect.h Example File

FFTRealUseTrigo.h Example File

OscSinCos.h Example File

TestAccuracy.h Example File

TestHelperFixLen.h Example File

TestHelperNormal.h Example File

TestSpeed.h Example File

TestWhiteNoiseGen.h Example File

def.h Example File

fftreal_wrapper.cpp Example File

fftreal_wrapper.h Example File

test.cpp Example File

test_fnc.h Example File

test_settings.h Example File

ClockCycleCounter.cpp Example File

ClockCycleCounter.h Example File

Int64.h Example File

StopWatch.cpp Example File

StopWatch.h Example File

def.h Example File

fnc.h Example File

engine.cpp Example File

engine.h Example File

frequencyspectrum.cpp Example File

frequencyspectrum.h Example File

levelmeter.cpp Example File

levelmeter.h Example File

mainwidget.cpp Example File

mainwidget.h Example File

progressbar.cpp Example File

progressbar.h Example File

settingsdialog.cpp Example File

settingsdialog.h Example File

spectrograph.cpp Example File

spectrograph.h Example File

spectrum.h Example File

spectrumanalyser.cpp Example File

spectrumanalyser.h Example File

tonegenerator.cpp Example File

tonegenerator.h Example File

tonegeneratordialog.cpp Example File

tonegeneratordialog.h Example File

utils.cpp Example File

utils.h Example File

waveform.cpp Example File

waveform.h Example File

wavfile.cpp Example File

wavfile.h Example File

main.cpp Example File

spectrum.pro Example File

fftreal.pro Example File

app.pro Example File

spectrum.qrc Example File

record.png Image File

settings.png Image File