resample lacks appropriate lowpass filtering
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Greg Dionne
le 3 Juin 2014
Modifié(e) : Greg Dionne
le 3 Juin 2014
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 commentaires
Greg Dionne
le 10 Juin 2014
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?
Voir également
Catégories
En savoir plus sur Multirate Signal Processing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!