Digital Signal Processing Reference
In-Depth Information
Fig. 17.2. Spectrogram of
the chirp signal
x 2 [ k ] = cos(0.0001π k 2 )
from Example 17.2.
0
0.1 p
0.2 p
0.3 p
0.4 p
0.5 p
0.6 p
0.7 p
0.8 p
0.9 p
p
W
k
0
5000 10 000 15 000 20 000 25 000 30 000 35 000 40 000
resolution. A longer window, therefore, generates a narrow-band spectrogram
while a shorter window generates a wide-band spectrogram. Similarly, the over-
lap chosen between two consecutive windows provides continuity and reduces
sharp transitions in the spectrogram.
17.1.2 Spectrogram computation using M ATLAB
In M ATLAB , the signal processing toolbox includes the function specgram
for calculating the spectrogram of a signal. The spectrogram in Example 17.2
is computed using the following code:
>> k = [0:39999];
>> x2= cos(0.0001*pi*k.*k) ;
>> Fs = 1;
>> Nwind = 901; Nfft = 1024; Noverlap = 600;
>> [spgram, F, T] = specgram(x2, Nfft, Fs, hanning(Nwind),
Noverlap);
>> imagesc([0 length(x2)/Fs], 2*pi*F,
20*log10(abs(spgram) + eps));
>> colormap(gray)
The M ATLAB function imagesc displays the spectrogram using a color map.
We can set the color map to gray using the last command in the code.
17.1.3 Random signals
The signals that we have studied so far are referred to as deterministic signals.
Such signals can be specified by unique mathematical expressions, allowing us
to calculate them precisely for all time. A second category consists of signals
that cannot be predicted precisely in advance, which are collectively referred
to as random or stochastic signals. Individual values of stochastic signals carry
Search WWH ::




Custom Search