resample lacks appropriate lowpass filtering
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Greg Dionne
el 3 de Jun. de 2014
Editada: Greg Dionne
el 3 de Jun. de 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 comentarios
Greg Dionne
el 10 de Jun. de 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?
Ver también
Categorías
Más información sobre Multirate Signal Processing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!