Digital Signal Processing Reference
In-Depth Information
10.8 TIME-FREQUENCY ANALYSIS OF SIGNALS WITH SPECTROGRAM
This project makes use of the short time Fourier transform (STFT) for the analysis
of signals, resulting in a spectrogram plot [33,34]. A spectrogram is a plot of the fre-
quencies that make up a particular signal. The magnitude of the frequency at a par-
ticular time is represented by the colors in the graph. This plot of frequency versus
time provides information on the changing frequency content of a signal over time.
The spectrogram is the square of the absolute value of the STFT of a signal. The
STFT looks at a nonstationary signal as small blocks in time and takes the Fourier
transform of each block to obtain the frequency content of the signal at that time.
This involves multiplying the signal with a moving window to observe smaller seg-
ments of the signal and taking the Fourier transform of the product. The use of a
sliding window and its size needs to be determined. A large window size (length)
can be chosen to enhance the frequency resolution, but at the expense of the time
resolution, and vice versa. The window increment, which represents the distance
between successive windows, also needs to be determined.
A spectrogram can be more useful than a plot of the spectrum since there can
be a different spectrum for each time. The spectrogram is plotted as frequency
versus time as a three-dimensional plot. Consider a musical scale consisting of eight
musical notes representing the C scale major: C, D, E, F, G, A, B, C with the fol-
lowing sinusoidal frequencies: 262, 294, 330,...,523, respectively, starting with the
middle C at a frequency of 262 Hz. The subsequent C is one octave higher at
523 Hz, which represents a doubling in frequency. A spectrogram plot of frequency
versus time would identify each note as it is played.
Time-frequency analysis techniques include the STFT, Gabor expansion, and
energy distribution based techniques such as the Wigner-Ville distribution. These
techniques are used to study the behavior of nonstationary signals such as music
and speech signals.
The files for this project are in the folder spectrogram (with separate
subfolders). The spectrogram project is decomposed into three separate sections
(versions), all of which make use of MATLAB's function imagesc to plot the
spectrogram:
1. Simulation using MATLAB to read a.wav file and plot its spectrogram
2. RTDX with MATLAB and use of a C-coded FFT function
3. RTDX with Visual C
++
and a radix-4 optimized FFT function
10.8.1 Simulation Using MATLAB
This is a simulated version using MATLAB. Figure 10.14 a shows the MATLAB file
spectrogram.m that plots a spectrogram, using the function wavread to read a
. wav file chirp.wav that is a swept sinusoidal signal. MATLAB's FFT function is
also used, as well as the function imagesc , to find the spectrogram of the input
.wav file.
Search WWH ::




Custom Search