Good morning,

the other day I was lashing up some tests for butter.m in the signal package. To my surprise, the low-pass filter showed much higher stopband attenuation than I'd expected.

Now I wonder whether that's a bug or a feature due to compatibility with Matlab.

Could someone who has access to Matlab please run the attached script and post the results?

Thanks in advance,

        Alex

--
          Dr. Alexander Klein, Diplom-Mathematiker

Physiologisches Institut       |               TransMIT Zentrum
Raum 543                       |        für Numerische Methoden
Aulweg 129                     |          Heinrich-Buff-Ring 44
35392 Giessen                  |                  35392 Giessen
function retval = sinewave (f, r, s, a)

  n = length (f);
  ns = round (r * s);

  retval = zeros (ns, n);

  for k = 1:n
    retval (:, k) = a(k) * sin (2 * pi * (1:ns) / r * f(k))';
  endfor

endfunction


sf = 1000; sf2 = sf/2;
data=[sinewave(5,sf,10,1),sinewave(10,sf,10,1),sinewave(50,sf,10,1),sinewave(200,sf,10,1),sinewave(400,sf,10,1)];
[b, a] = butter ( 1, 50 / sf2 );
filtered = filter ( b, a, data );
damp_db = 20 * log10 ( max ( filtered ( end - sf : end, : ) ) )
[b, a] = butter ( 4, 50 / sf2 );
filtered = filter ( b, a, data );
damp_db = 20 * log10 ( max ( filtered ( end - sf : end, : ) ) )
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to