필터 지우기
필터 지우기

why is periodogram(y,w) not periodogram(y.*w)

조회 수: 1 (최근 30일)
Wesley Ooms
Wesley Ooms 2014년 2월 6일
편집: Wesley Ooms 2014년 2월 7일
why is periodogram(y,w) not the same as periodogram(y.*w), where y is the signal and w the window. For a rectangular window it is the same but for a hanning window there is a difference that has something to do with the mean and variance of the window I guess. What exactly is this difference? And why is this difference there? Same holds for pwelch.

채택된 답변

Wayne King
Wayne King 2014년 2월 6일
편집: Wayne King 2014년 2월 6일
The difference is that the syntax periodogram(y,w) uses the window normalization constant explained here:
Read about the modified periodogram.
While periodogram(y.*w) does not use that normalization because you are using a rectangular window
I would recommend using
periodogram(y,w)
However, if you look at the two periodograms, you'll see that one is simply a scaled version of the other and that scaling is due to window normalization you get with
periodogram(y,w)
  댓글 수: 1
Wesley Ooms
Wesley Ooms 2014년 2월 7일
편집: Wesley Ooms 2014년 2월 7일
Thanks alot, That is a very good link
For other people who are interested: this is how to go from fft to periodogram (amplitude power spectrum) and from periodogram to pwelch:
y = load('data.mat') ;% samples
t = load('time.mat') ;% time
d = mean(diff(t)) ;% delta time
N = length(y) ;% number of samples
a = 10 ;% number of averages
o = 1000 ;% overlap
l = floor((N+o*(a-1))/a) ;% length of time vectors
w = (1-cos(2*pi*(1:l)/(l+1))) ;% window
f = ceil(-N/2:N/2-1)/d/N ;% frequency points
P = pwelch(y,w,o,l) ;% -----> pwelch <-----
n = floor(l/2)+1;p=eye(n,a);q=p ;% initialize variables
for k=1:a;
z = y((1:l)+(l-o)*(k-1)) ;
p(:,k) = periodogram(z,w,l) ;% -----> periodogram <-----
Y = fft(z'.*w) ;% -----> fft <-----
Y = [Y(1)/sqrt(2) Y(2:n-1) Y(n)/sqrt(2-rem(l,2))];
q(:,k) = Y.''.*Y/pi/(w*w') ;
end
p = mean(p,2); q = mean(q,2) ;% average
figure(1);clf ;% post processing
subplot(311); plot(y);
subplot(312); plot(P);hold all;plot(p);plot(q)
subplot(313); plot(abs(P)-abs(q))
linkaxes(get(figure(1),'children'),'x')

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

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by