%% DC-Centered Multitaper PSD Estimate
% Obtain the multitaper PSD estimate of a 100 Hz sine wave in additive N(0,1) noise. The data are sampled at 1 kHz. Use the 'centered' option to obtain the DC-centered PSD.

fs = 1000;
t = 0:1/fs:2-1/fs;
x = cos(2*pi*100*t)+randn(size(t));
[pxx,f] = pmtm(x,3.5,length(x),fs,'centered');

%
% Plot the DC-centered PSD estimate.

pmtm(x,3.5,length(x),fs,'centered')

% Copyright 2015 The MathWorks, Inc.