Paramerer setting for pmtm() multitaper method

조회 수: 11 (최근 30일)
Kyle
Kyle 2011년 9월 11일
Hi all, I'm trying to do spectral analysis by pmtm method:
clear
clc; 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
  댓글 수: 2
bym
bym 2011년 9월 11일
have you read the reference cited? [1] Percival, D.B., and A.T. Walden, Spectral Analysis for Physical Applications: Multitaper and Conventional Univariate Techniques, Cambridge University Press, 1993.
Kyle
Kyle 2011년 9월 13일
Our library doesn't have this book unfortunately. Could you please suggest a few pages that may be mostly related so I can ask for an interloan. Thanks

댓글을 달려면 로그인하십시오.

채택된 답변

Wayne King
Wayne King 2011년 9월 13일
Hi Kyle, the mainlobe is approximately [-w/n, w/n]*Fs in Hz where Fs is your sampling frequency. For a given time-bandwidth product, nw, there are approximately 2*nw-1 Slepian tapers that have eigenvalues near unity, meaning that they have approximately all their energy in the bandwidth [-w/n,w/n]*Fs. The eigenvalue gives the proportion of energy in that band. To follow up on what Honglei wrote, as you increase your nw, you can use more tapers (because more of them will have eigenvalues near 1). Using more tapers increases the degrees of freedom and reduces the variance of your spectal estimate (it looks smoother), but widens the main lobe so you will less precisely localize the frequency of a peak and if there are multiple peaks within the mainlobe, those peaks can be smeared together (meaning multiple peaks may look like broad one).
Wayne
  댓글 수: 1
Kyle
Kyle 2011년 9월 13일
Thanks Wayne, that's very helpful, now I think I can understand the principle of multitaper method.
If I change T =2 and w = 1 in my code, so that w/T*Fs = 150 Hz, meaning that spectral power will be mostly distributed within the range [-150, 150]Hz in order to detect two peaks locating at 50Hz and 120Hz, does that make sense?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Honglei Chen
Honglei Chen 2011년 9월 12일
Hi Kyle,
The time-bandwidth product, nw, gives you a trade-off of the variance and resolution. When it gets larger, more windows are applied to the signal so there are more averaging to the resulting spectrum. However, larger nw also means that for each window, the mainlobe is wider so the resolution takes a hit.
HTH,
Honglei
  댓글 수: 1
Kyle
Kyle 2011년 9월 13일
Hi Honglei, thank you for your helpful explanation.
What do you mean by "mainlobe" here? Can you give any hints for selecting appropriate "nw" value? thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by