resample lacks appropriate lowpass filtering
2 次查看(过去 30 天)
显示 更早的评论
Surprisingly, resample does not seem to apply appropriate filtering to avoid aliasing. Try: x=randn(10000,1); pwelch(decimate(x,2)); hold on pwelch(resample(x,1,2));
decimate does the right thing, which is to first lowpass filter with a cutoff below the new Nyquist frequency. resample does not. The result is that power above the original Nyquist frequency is aliased into the downsampled signal.
Annoyingly, decimate works only on vectors.
Am I missing something?
Alain
0 个评论
回答(1 个)
Greg Dionne
2014-6-3
编辑:Greg Dionne
2014-6-3
I think resample has a higher cutoff frequency to admit more of the Nyquist range. If I'm interpreting your plot correctly, DECIMATE has a 3dB point near 0.8 pi rad/s; whereas the 3dB point of RESAMPLE is closer to 1.0 pi rad/s.
To convince yourself that there is (some) alias attenuation try something like:
t = (1:10000)/10000;
x = cos(2*pi*(100*t + 200*t.^2)) + cos(2*pi*(2500*t + 200*t.^2));
pwelch(x)
title('original PSD')
figure
pwelch(decimate(x,2));
hold on;
pwelch(resample(x,1,2));
title('decimated PSD')
Hope this helps a little.
2 个评论
Greg Dionne
2014-6-10
I did a little more digging. RESAMPLE allows you to take a set of FIR coefficients. You could always try something like (?)
pwelch(resample(x,1,2,fir1(40,.8*1/2)));
I think that will get you a little closer to the behavior of DECIMATE.
Out of curiosity, what are your bandwidth requirements?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multirate Signal Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!