PlotSpectrogram PDF
PlotSpectrogram PDF
This program plots spectrograms (vertical slices of intensities versus frequencies, with slices plotted
against time). PlotSpectrogram is designed for ease of use.
Features:
Intensities are in log units, with the dynamic range limited (80 dB by default). This strategy
avoids the problem of low level portions of the spectrogram expanding the dynamic range and
thereby obscuring the detail of the energetic portions.
The intensities are calculated as absolute units of dBov (decibels relative to overload).
The time-frequency resolution of the spectrogram can be controlled. The bandwidth resolution
of the spectrogram can be directly specified. The default is a narrowband spectrogram.
Optionally, the analysis window can be specified in terms of coefficients, bandwidth, or length.
The frequency transform properly takes into account the time-aliasing when analyzing long
windows (corresponding to small bandwidths).
The number of spectrogram slices can be specified (default 500).
The number of frequency points can be specified (default is to automatically choose either 513
or 1025 values, depending on the window length).
An optional pre-emphasis can be applied to better show the high frequency intensities.
All windows are centered at their respective time points. This means that the windows at the
end points of the time interval will include samples on both sides of the end points.
A subset of frequencies can be plotted to give an expanded view.
The default plot uses a gray-scale (dark is more intense). The spectrogram can optionally be
colorized using the SpecColorMap (included). This mapping adds color (pale yellow through red
going to black) but also reproduces properly in gray-level when photocopied.
Example
The spectrogram shown below was created with the following Matlab code.
The input data is taken from a short speech file sampled at 8 kHz. The test file and a test script are
included with the distribution. The resulting narrowband spectrogram appears in color. The
accompanying colorbar is labelled with dB values in dB relative to overload (dBov).