decimate shifts frequency

I used decimate.m in order to down sample my data and applied it to wavelet to see time-frequency map.
ex)
downdata = decimate(data,2,500,'FIR') or decimate(data,2)
waveletdata = cwt(downdata,scale);
When I compare it with original data, I realized the frequency was shifted.
Are there any way to fix it?
Thanks

댓글 수: 2

Walter Roberson
Walter Roberson 2012년 6월 15일
Was it the phase that was shifted? I am not clear on what it would mean for the frequency to be shifted.
scally12
scally12 2012년 6월 15일
Please see the Wayne's answer.

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

 채택된 답변

Wayne King
Wayne King 2012년 6월 15일

1 개 추천

You have not shown us what your scale vector is for the cwt, but if you decimate the data, then you are changing the scale at which a given frequency occurs. So the energy in the CWT coefficients is going to shift in scale.
You should construct an appropriate scale vector for your "new" sampling rate and the expected frequencies in your input.
You can also use scal2frq to get an approximate frequency vector from your scale vector.

추가 답변 (2개)

Wayne King
Wayne King 2012년 6월 15일

0 개 추천

Here is an example:
Fs = 1e4;
t = 0:1/Fs:1-1/Fs;
x = cos(2*pi*500*t).*(t<0.5)+cos(2*pi*1000*t).*(t>=0.5);
scales1 = 1:0.25:30;
cfs1 = cwt(x,scales1,'morl');
freq1 = scal2frq(scales1,'morl',1/Fs);
surf(t,freq1,abs(cfs1),'edgecolor','none');
view(0,90);
Now decimate by 2.
y = decimate(x,2,500,'fir');
Fsnew = Fs/2;
scales2 = 1:0.01:15;
cfs2 = cwt(y,scales2,'morl');
freq2 = scal2frq(scales2,'morl',1/Fsnew);
tnew = 0:1/Fsnew:1-(1/Fsnew);
surf(tnew,freq2,abs(cfs2),'edgecolor','none');
view(0,90)
scally12
scally12 2012년 6월 15일

0 개 추천

Wayne, you are right! The CWT coefficients was shift in frequency (I transferred it with scl2frq). It was my mistake. I didn't update the sampling rate in scal2frq.
Thank so much.

카테고리

도움말 센터File Exchange에서 Continuous Wavelet Transforms에 대해 자세히 알아보기

태그

질문:

2012년 6월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by