%% Average Single-Taper Estimates with Unity Weights
% Obtain a multitaper PSD estimate where the individual tapered direct spectral estimates are given equal weight in the average.
% Obtain the multitaper PSD estimate of a signal sampled at 1 kHz. The signal is a 100 Hz sine wave in additive N(0,1) white noise. The signal duration is 2 s. Use a time-halfbandwidth product of 3 and a DFT length equal to the signal length. Use the 'unity' option to give equal weight in the average to each of the individual tapered direct spectral estimates.

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

%
% Plot the multitaper PSD estimate.

pmtm(x,3,length(x),fs,'unity')

% Copyright 2015 The MathWorks, Inc.