%% Multitaper PSD Estimate of a Multichannel Signal
% Generate 1024 samples of a multichannel signal consisting of three sinusoids in additive N(0,1) white Gaussian noise. The sinusoids' frequencies are \pi/2, \pi/3, and \pi/4 rad/sample. Estimate the PSD of the signal using Thomson's multitaper method and plot it.

N = 1024;
n = 0:N-1;

w = pi./[2;3;4];
x = cos(w*n)' + randn(length(n),3);

pmtm(x)

% Copyright 2015 The MathWorks, Inc.