17.01.2013 Views

musicdsp.org source code archive - WSInf

musicdsp.org source code archive - WSInf

musicdsp.org source code archive - WSInf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

One pole LP and HP (click this to go back to the index)<br />

References : Posted by Bram<br />

Code :<br />

LP:<br />

recursion: tmp = (1-p)*in + p*tmp with output = tmp<br />

coefficient: p = (2-cos(x)) - sqrt((2-cos(x))^2 - 1) with x = 2*pi*cutoff/samplerate<br />

coeficient approximation: p = (1 - 2*cutoff/samplerate)^2<br />

HP:<br />

recursion: tmp = (p-1)*in - p*tmp with output = tmp<br />

coefficient: p = (2+cos(x)) - sqrt((2+cos(x))^2 - 1) with x = 2*pi*cutoff/samplerate<br />

coeficient approximation: p = (2*cutoff/samplerate)^2<br />

Comments<br />

from : skyphos_atw@hotmail.com<br />

comment : coefficient: p = (2-cos(x)) - sqrt((2-cos(x))^2 - 1) with x = 2*pi*cutoff/samplerate<br />

p is always -1 using the formula above. The square eliminates the squareroot and (2-cos(x)) - (2-cos(x)) is 0.<br />

from : q@q<br />

comment : Look again. The -1 is inside the sqrt.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!