Signal Processing Toolbox | Help Desk |
pmtm
Power spectrum estimate using the multitaper method (MTM).
Pxx = pmtm(x) Pxx = pmtm(x,nw) Pxx = pmtm(x,nw,nfft) [Pxx,f] = pmtm(x,nw,nfft,Fs) [Pxx,f] = pmtm(x,nw,nfft,Fs,'method
') [Pxx,Pxxc,f] = pmtm(x,nw,nfft,Fs,'method
') [Pxx,Pxxc,f] = pmtm(x,nw,nfft,Fs,'method
',p) [Pxx,Pxxc,f] = pmtm(x,e,v,nfft,Fs,'method
',p) [Pxx,Pxxc,f] = pmtm(x,dpss_params,nfft,Fs,'method
',p)
pmtm
estimates the power spectral density (PSD) of the real time series x using the multitaper method (MTM), described in [1].
Pxx = pmtm(x,nw)
estimates the PSD using nw
as the time-bandwidth product for the discrete prolate spheroidal sequences (Slepian sequences) that are used as data windows. The default for nw
is 4; other typical choices arePxx
is 2
*nw-1
.
Pxx = pmtm(x,nw,nfft)
defines the frequency grid as length nfft
. When x
is real, Pxx
is length (nfft/2+1)
for nfft
even and (nfft+1)/2
for nfft
odd; when x
is complex, Pxx
is length nfft
. The default for nfft
is 256 or the next power of 2 greater than the length of x
, whichever is larger.
[Pxx,f] = pmtm(x,nw,nfft,Fs)
returns f
, the vector of frequencies at which the PSD is estimated, for the sampling frequency Fs
. The default for Fs
is 2 Hz.
[Pxx,f] = pmtm(x,nw,nfft,Fs,'method
')
specifies the algorithm used for combining the individual spectral estimates, where method is
adapt
, to specify Thomson's adaptive nonlinear combination (default)
unity
, to specify a linear combination with unity weights
eigen
, to specify a linear combination with eigenvalue weights
[Pxx,Pxxc,f] = pmtm(x,nw,nfft,Fs,'method
')
returns Pxxc
, the 95% confidence interval for Pxx
, and
[Pxx,Pxxc,f] = pmtm(x,nw,nfft,Fs,'method
',p)
returns Pxxc
, the p
*100%
confidence interval for Pxx
, where p
is a scalar between 0 and 1. Confidence intervals are computed using a chi-squared approach, where Pxxc(:,1)
is the lower bound and Pxxc(:,2)
is the upper bound of the confidence interval.
[Pxx,Pxxc,f] = pmtm(x,e,v,nfft,Fs,'method
',p)
returns the PSD estimate Pxx
, the confidence interval Pxxc
, and the frequency vector f
from the data tapers in e
and their concentrations v
.
[Pxx,Pxxc,f] = pmtm(x,dpss_params,nfft,Fs,'method
',p)
returns the PSD estimate Pxx
, the confidence interval Pxxc
, and the frequency vector f
from the data tapers computed using dpss
with parameters from the cell array dpss_params
, starting with the second element of the array. The first parameter is set by the length of x
. For example, pmtm(x,{3.5,'calc','trace'},512,Fs)
forces direct calculation of the Slepian sequences. See dpss
for options.
pmtm
with no output arguments plots the PSD in the current or next available figure, with confidence intervals.
To use default parameters for any argument in an expression, insert an empty matrix []
. For example, pmtm(x,[],[],1000)
uses defaults for the second and third elements, in this case, nw
and nfft
.
This example analyzes a sinusoid in white noise:
Fs = 1000; t = 0:1/Fs:0.3; x = cos(2*pi*t*200) + randn(size(t)); [Pxx,Pxxc,f] = pmtm(x,3.5,512,Fs,[],0.99); plot(f,10*log10([Pxx Pxxc]))
![]()