Navigation

Operators and Keywords

Function List:

C++ API

: [Pxx, w] = periodogram (x)
: [Pxx, w] = periodogram (x, win)
: [Pxx, w] = periodogram (x, win, nfft)
: [Pxx, f] = periodogram (x, win, nfft, Fs)
: [Pxx, f] = periodogram (…, "range")
: periodogram (…)

Return the periodogram (Power Spectral Density) of x.

The possible inputs are:

x

data vector. If x is real-valued a one-sided spectrum is estimated. If x is complex-valued, or "range" specifies "twosided", the full spectrum is estimated.

win

window weight data. If window is empty or unspecified a default rectangular window is used. Otherwise, the window is applied to the signal (x .* win) before computing the periodogram. The window data must be a vector of the same length as x.

nfft

number of frequency bins. The default is 256 or the next higher power of 2 greater than the length of x (max (256, 2.^nextpow2 (length (x)))). If nfft is greater than the length of the input then x will be zero-padded to the length of nfft.

Fs

sampling rate. The default is 1.

range

range of spectrum. "onesided" computes spectrum from [0..nfft/2+1]. "twosided" computes spectrum from [0..nfft-1].

The optional second output w are the normalized angular frequencies. For a one-sided calculation w is in the range [0, pi] if nfft is even and [0, pi) if nfft is odd. Similarly, for a two-sided calculation w is in the range [0, 2*pi] or [0, 2*pi) depending on nfft.

If a sampling frequency is specified, Fs, then the output frequencies f will be in the range [0, Fs/2] or [0, Fs/2) for one-sided calculations. For two-sided calculations the range will be [0, Fs).

When called with no outputs the periodogram is immediately plotted in the current figure window.

See also: fft.

Package: octave