|
| WaveWarp 2.0 Example DrawingBoard

SpectrumAnalyserEducationalExample
Description
Spectrum Analyser Educational Example
Illustrates the use of the Spectrum Analyser block for computing in real-time the spectrum of an audio signal. In this
example, a pure sine wave signal (from the Sine Wave Generator) is analysed in order to highlight some of the key features
of the spectrum analyser. With the default DrawingBoard settings, the frequency of the sine wave is 3300 Hz. Play the
Drawing Board and observe the response in the plot window of the Spectrum Analyser. You will see a sharp spike at 3300
Hz, corresponding to the pure tone. The height of the spike is approximately 0.71. This is the rms value of the signal
amplitude. Recalling that the rms amplitude of a pure sine wave is equal to the amplitude of the sine wave divide by the
square-root of 2, then the value of 0.71 is consistent with the amplitude of 0.999 for the sine wave (as set in the Parameter
Window of the Sine Wave generator). This demonstrates that the Spectrum Analyser is calibrated to give direct rms values,
which is useful to know when comparing spectra from different signals.
Note that the "Window type" is set to "None" in the Parameter Window of the Spectrum Analyser. Now select the
"Hanning" type. You will observe a drop in the rms level displayed in the plot. This is consistent with the fact that the
windowing operation reduces the overall energy of the signal (since it smoothly reduces the amplitude to zero at the edges
of the window). However, the windowing significantly increases the accuracy of the spectral measurement. You can see
this more clearly by switching the Spectrum Analyser to its "dB scale". If you now compare the spectra with and without
windowing, you will note that the windowing reduces the "noise" (i.e. undesirable FFT artefacts) by about 90 dB (for the
default FFT settings). This drastic improvement is the main justification for employing windowing when analysing with the
FFT (the basis of the Spectrum analyser block).
Now try increasing the "Window length" (and hence the FFT length) of the Spectrum Analyser. You will not that the
resolution of the spectrum improves with Window length. (This is best observed in the dB-scale. Increasing the Window
length leads to a "sharpening" of the main spike, and an overall reduction in "noise"). This reflects a key property of the
FFT, namely that the frequency resolution increases with measurement duration (window length). Also try selecting the
"double-padding" which doubles the length of the FFT for a given data window length (by padding with zeros). This does
not increase the frequency resolution (since no additional actual data is introduced in the analysis), but it does have the
effect of smoothing the transition between neighbouring frequency bins (thus leading to a smoother looking spectrum).
Another point to note concerns the use of the "Averaging" feature of the Spectral Analyser. In this example of a pure
continuous tone, averaging the spectral measurements is not neccesary. However, for general time-varying spectra, the
averaging can be employed to give a smooth overview of the broad spectral characteristics (without having to use longer
FFT lengths !).
Try experimenting with all settings of the Spectrum Analyser to explore its behaviour. Also try using different input signals
(such as real audio data rather than pure tones !) Also note that you can save the measured spectrum to a file using the
"Save average spectrum to file" dialog box. This is a useful feature if you wish to perform off-line post-processing of the
measured spectra. (See "wwxmpl11.m" in the wwmatlab directory for an example of how to read a spectrum generated by
WaveWarp into MATLAB for post-processing).
Components used:

|
|