Qt 4.7: Spectrum Analyzer

Qt Reference Documentation

# Spectrum Analyzer

Files:

- demos/spectrum/3rdparty/fftreal/Array.h
- demos/spectrum/3rdparty/fftreal/DynArray.h
- demos/spectrum/3rdparty/fftreal/FFTReal.h
- demos/spectrum/3rdparty/fftreal/FFTRealFixLen.h
- demos/spectrum/3rdparty/fftreal/FFTRealFixLenParam.h
- demos/spectrum/3rdparty/fftreal/FFTRealPassDirect.h
- demos/spectrum/3rdparty/fftreal/FFTRealPassInverse.h
- demos/spectrum/3rdparty/fftreal/FFTRealSelect.h
- demos/spectrum/3rdparty/fftreal/FFTRealUseTrigo.h
- demos/spectrum/3rdparty/fftreal/OscSinCos.h
- demos/spectrum/3rdparty/fftreal/TestAccuracy.h
- demos/spectrum/3rdparty/fftreal/TestHelperFixLen.h
- demos/spectrum/3rdparty/fftreal/TestHelperNormal.h
- demos/spectrum/3rdparty/fftreal/TestSpeed.h
- demos/spectrum/3rdparty/fftreal/TestWhiteNoiseGen.h
- demos/spectrum/3rdparty/fftreal/def.h
- demos/spectrum/3rdparty/fftreal/fftreal_wrapper.cpp
- demos/spectrum/3rdparty/fftreal/fftreal_wrapper.h
- demos/spectrum/3rdparty/fftreal/test.cpp
- demos/spectrum/3rdparty/fftreal/test_fnc.h
- demos/spectrum/3rdparty/fftreal/test_settings.h
- demos/spectrum/3rdparty/fftreal/stopwatch/ClockCycleCounter.cpp
- demos/spectrum/3rdparty/fftreal/stopwatch/ClockCycleCounter.h
- demos/spectrum/3rdparty/fftreal/stopwatch/Int64.h
- demos/spectrum/3rdparty/fftreal/stopwatch/StopWatch.cpp
- demos/spectrum/3rdparty/fftreal/stopwatch/StopWatch.h
- demos/spectrum/3rdparty/fftreal/stopwatch/def.h
- demos/spectrum/3rdparty/fftreal/stopwatch/fnc.h
- demos/spectrum/app/engine.cpp
- demos/spectrum/app/engine.h
- demos/spectrum/app/frequencyspectrum.cpp
- demos/spectrum/app/frequencyspectrum.h
- demos/spectrum/app/levelmeter.cpp
- demos/spectrum/app/levelmeter.h
- demos/spectrum/app/mainwidget.cpp
- demos/spectrum/app/mainwidget.h
- demos/spectrum/app/progressbar.cpp
- demos/spectrum/app/progressbar.h
- demos/spectrum/app/settingsdialog.cpp
- demos/spectrum/app/settingsdialog.h
- demos/spectrum/app/spectrograph.cpp
- demos/spectrum/app/spectrograph.h
- demos/spectrum/app/spectrum.h
- demos/spectrum/app/spectrumanalyser.cpp
- demos/spectrum/app/spectrumanalyser.h
- demos/spectrum/app/tonegenerator.cpp
- demos/spectrum/app/tonegenerator.h
- demos/spectrum/app/tonegeneratordialog.cpp
- demos/spectrum/app/tonegeneratordialog.h
- demos/spectrum/app/utils.cpp
- demos/spectrum/app/utils.h
- demos/spectrum/app/waveform.cpp
- demos/spectrum/app/waveform.h
- demos/spectrum/app/wavfile.cpp
- demos/spectrum/app/wavfile.h
- demos/spectrum/app/main.cpp
- demos/spectrum/spectrum.pro
- demos/spectrum/3rdparty/fftreal/fftreal.pro
- demos/spectrum/app/app.pro
- demos/spectrum/app/spectrum.qrc

The Spectrum Analyzer demo shows how the QtMultimedia Module can be used in Qt applications to capture and then play back an audio stream.

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

- Information about the raw audio stream, shown in the uppermost widget:
  - The amount of data currently in the buffer, shown in blue
  - The segment of data which was most recently analysed to compute the frequency spectrum, shown in green
  - The raw audio waveform, shown in white and scrolling from right to left
- 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.