SignalProcessing - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Science and Engineering : Signal Processing : Visualization : SignalProcessing/Spectrogram

SignalProcessing

  

Spectrogram

  

plot the spectrogram of a signal

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Spectrogram(f)

Parameters

f

-

: string, rtable, list : a signal, the name of a file containing a signal, or a list of these

Options

• 

channel, column : posint, or list(posint) : channel or rtable column, or list of these

• 

compactplot : boolean : indicates that multiple plots are to be displayed more compactly

• 

fftsize : posint : FFT window size

• 

includepowerspectrum : boolean or list : indicates if power spectrum is to be plotted

• 

includesignal : boolean or list : indicates if signal is to be plotted

• 

reduceplot : boolean or posint : indicates that plot resolution is to be reduced

• 

samplerate : realcons : the sample rate

• 

window : name or list : the name of a windowing procedure or a list containing the procedure name and additional arguments to the procedure

Description

• 

The Spectrogram command plots the spectrogram of one or more signals. Optionally, the amplitude of the signal and the power spectrum can be plotted along with the spectrogram. The input f can be the name of a file containing an audio signal, an rtable, or a list. See AudioTools:-Format for information about the kinds of files accepted.

• 

If f is not an audio signal, then the samplerate option must be included. See the information about the samplerate option below.

• 

If f is an m by n Matrix (or 2-dimensional Array), then it is assumed to contain n signals of length m. In this case, spectrograms of all signals are plotted and displayed in an array plot. Similarly, if f is an audio signal with multiple channels, then plots for all channels are produced.  If you do not wish to plot all signals, the channel and column options allow you to plot a subset.

• 

If f is a list, then every element of the list must be a single-channel audio signal or a 1-dimensional Array.

• 

The option fftsize determines the FFT window size and its value must be a power of 2 greater than 2.

• 

The compactplot option allows multiple plots to be displayed more compactly. When this option is set to true, it is assumed the x-axis labels for all plots are identical and thus they are displayed for the bottommost plot only.

• 

If includesignal or includesignal=true is given as an option, then the original signal is also plotted. If includesignal=t, where t is a list, is given, then the signal is plotted using the contents of t as additional plotting options.

• 

The includepowerspectrum option is similar to the includesignal option but produces a plot of the power spectrum instead.

• 

If the signal is particularly large and the reduceplot option is set to true, then the plot resolution is automatically reduced for efficient rendering. If reduceplot is a positive integer, then the plot is reduced by that factor. The default setting for this option is true.

• 

The samplerate option is used to specify a sample rate, in the case where one cannot be deduced. Note that audio signals generated or recognized by the AudioTools package have the sample rate saved in their attributes. If f is not such a signal, then the sample rate must be provided using this option.

• 

The window option you to specify the windowing command. Any of the windowing commands available in the SignalProcessing package can be used. The default is SignalProcessing:-HammingWindow. A string such as "Bartlett" may be provided and is interpreted as the SignalProcessing:-BartlettWindow command in this case.

• 

Additional plot options may be provided and are applied to the spectrogram plot. The size and axes options are also automatically applied to the signal and power spectrum plots, if they have been requested. These may be overridden by suboptions given through the includesignal and includepowerspectrum options in list form.  

• 

To change the coloring of the spectrogram, use the colorscheme option, as described on the plot/colorscheme help page.

Examples

withSignalProcessing:

audiofilecatkerneloptsdatadir,/audio/stereo.wav:

Spectrogramaudiofile,compactplot

Spectrogramaudiofile,channel=1,includesignal=color=Navy,includepowerspectrum,channel=1,colorscheme=Orange,SteelBlue,Navy

Compatibility

• 

The SignalProcessing[Spectrogram] command was introduced in Maple 18.

• 

For more information on Maple 18 changes, see Updates in Maple 18.

See Also

AudioTools:-Format

SignalProcessing

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam