Periodogram - Maple Help

SignalProcessing

 Periodogram
 plot the periodogram of a signal

 Calling Sequence Periodogram(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 : truefalse : indicates that multiple plots are to be displayed more compactly
 • detrend : truefalse : indicates if the data should have any trend removed
 • frequencyscale : anything
 • powerscale : identical( "dB", "dB/Hz", "absolute" ) : indicates the power scale
 • reduceplot : truefalse or posint : indicates that plot resolution is to be reduced
 • samplerate : realcons : the sample rate
 • timeunit : anything

Description

 • The Periodogram command plots the power spectrum for one or more signals. 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 an $m$ by $n$ Matrix (or 2-dimensional Array), then it is assumed to contain $n$ signals of length $m$. In this case, 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 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.
 • The detrend option specifies if the data should have any linear trend removed before being plotted.
 • The frequencyscale option controls the scaling used on the frequency axis. The default is Hz.
 • The powerscale option controls the scaling used on the power axis and can be one of "dB", "dB/Hz" or "absolute". The default is "dB".
 • 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. Note that audio signals generated by the AudioTools package have the sample rate saved in their attributes.
 • The timeunit option is used to specify the unit time of the sample rate. The default value is s.
 • Additional plotting options as described on the plot/option help page may be included.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$

Generate a signal equal to the sum of two sinusoids with frequencies of 12 Hz and 24 Hz, sampled at 100 Hz:

 > $\mathrm{f1}≔12.0:$
 > $\mathrm{f2}≔24.0:$
 > $\mathrm{signal}≔\mathrm{Vector}\left({2}^{10},i↦\mathrm{sin}\left(\frac{\mathrm{f1}\cdot \mathrm{\pi }\cdot i}{50}\right)+1.5\cdot \mathrm{sin}\left(\frac{\mathrm{f2}\cdot \mathrm{\pi }\cdot i}{50}\right),\mathrm{datatype}=\mathrm{float}\left[8\right]\right)$
 ${{\mathrm{_rtable}}}_{{36893628696909549564}}$ (1)
 > $\mathrm{Periodogram}\left(\mathrm{signal},\mathrm{samplerate}=100\right)$
 > $\mathrm{audiofile}≔\mathrm{cat}\left(\mathrm{kernelopts}\left(\mathrm{datadir}\right),"/audio/maplesim.wav"\right):$
 > $\mathrm{Periodogram}\left(\mathrm{audiofile},\mathrm{frequencyscale}="kHz"\right)$
 > $\mathrm{audiofile2}≔\mathrm{cat}\left(\mathrm{kernelopts}\left(\mathrm{datadir}\right),"/audio/stereo.wav"\right):$
 > $\mathrm{Periodogram}\left(\mathrm{audiofile2},\mathrm{compactplot}\right)$

 > 

Compatibility

 • The SignalProcessing[Periodogram] command was introduced in Maple 2017.