From bug-octave-request at bevo dot che dot wisc dot edu Sun May 5 14:54:30 2002 Subject: decimate.m From: Mirek Kwasniak To: bug-octave at bevo dot che dot wisc dot edu Date: Sun, 5 May 2002 21:53:01 +0200 Hi, Tried decimate and got very weird results :( With FIR filter, you have only -10..-12 dB at new Nyquist frequency. Whith IIR even worse, cheby1 function gives badly scaled coefficients. You can see results for decimations factor 2:10 here: http://www.zind.ikem.pwr.wroc.pl/dydaktyka/mirek/dec_filters.ps My script at end (frequency axis normalized to 1 at new Nyquist frequency). Mirek PS Where report bugs agains octave-forge? ---------------------------------------------------- %/usr/share/octave/2.1.36/site/m/octave-forge/signal/fir1.m %/usr/share/octave/2.1.36/site/m/octave-forge/signal/cheby1.m %/usr/share/octave/2.1.36/site/m/octave-forge/FIXES/freqz.m clf; nsubplot(211); n=30; for q=2:10; b=fir1(n, 1/q); [H, W]=freqz(b,1); plot(W/pi*q,20*log10(abs(H).^2)); % square because decimate uses filtfilt end; grid('on'); title('FIR'); ax(0,2); ay(-60,6); nsubplot(212); n=8; for q=2:10; [b,a]=cheby1(n, 0.05, 1/q); [H, W]=freqz(b,1); plot(W/pi*q,20*log10(abs(H).^2)); end; grid('on'); title('IIR'); ax(0,2); drawnow ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------