Hi all, I'm trying to do spectral analysis by pmtm method:
clearclc; close all% artificial data
Fs = 300; % Sampling frequency
T = 1/Fs; % Sample time
L = 3000; % Length of signal
t = (0:L-1)*T; % Time vector
% Sum of a 50 Hz sinusoid and a 120 Hz sinusoid
x = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t); y = x + 3*randn(size(t)); % Sinusoids plus noise
y=y(:);% Spectral analysis
T = 0.5; % sec
W = 3; % -Hz
% Matlab multitaper method
nw = T*W; % nw is the time-bandwidth product
[Pxx, f] = pmtm(y, nw, [], Fs); plot(f, Pxx) % PSD
title('Spectral analysis by Matlab')
The graph looks fine, but actually, I have no ideas to set T and W. I just randomly put some numbers there. Could anyone please explain as simple as possible that how to select T and W, also how many tapers should be implemented to a specified signal (with unknown frequency of cause in a practical case).
Many thanks for any help Kyle
Best Answer