%% DFT Length Equal to Signal Length
% Obtain the multitaper PSD estimate of an input signal consisting of a discrete-time sinusoid with an angular frequency of \pi/4 rad/sample with additive N(0,1) white noise. Use a DFT length equal to the signal length.
% Create a sine wave with an angular frequency of \pi/4 rad/sample with additive N(0,1) white noise. The signal is 320 samples in length. Obtain the multitaper PSD estimate with a time-halfbandwidth product of 3 and a DFT length equal to the signal length. Because the signal is real-valued, the one-sided PSD estimate is returned by default with a length equal to 320/2+1.

n = 0:319;
x = cos(pi/4*n)+randn(size(n));
pmtm(x,3,length(x))

% Copyright 2015 The MathWorks, Inc.