Main Archive Specials Wiki | FAQ Links Submit Forum


One zero, LP/HP

References : Posted by Bram

Notes :
LP is only 'valid' for cutoffs > samplerate/4
HP is only 'valid' for cutoffs < samplerate/4


Code :
theta = cutoff*2*pi / samplerate

LP:
H(z) = (1+p*z^(-1)) / (1+p)
out[i] = 1/(1+p) * in[i] + p/(1+p) * in[i-1];
p = (1-2*cos(theta)) - sqrt((1-2*cos(theta))^2 - 1)
Pi/2 < theta < Pi

HP:
H(z) = (1-p*z^(-1)) / (1+p)
out[i] = 1/(1+p) * in[i] - p/(1+p) * in[i-1];
p = (1+2*cos(theta)) - sqrt((1+2*cos(theta))^2 - 1)
0 < theta < Pi/2



Comments


Added on : 22/04/03 by newbie attack
Comment :
What is the implementation of z^(-1)?



Added on : 29/06/04 by spam[ AT ]hell[ DOT ]no
Comment :
z^(-1) = 1/z



Added on : 26/07/06 by cam
Comment :
z^(-1) is a single sample delay. The second line of code is the actual filter code. First line is a transfer function.



Added on : 17/05/07 by Gorgr
Comment :
wt's the meaning of 'p'?



Added on : 21/04/14 by chippo
Comment :
And what's the meaning of 'z'?



Add your own comment
Comments are displayed in fixed width, no HTML code allowed!
Email:

Comment:

Are you human?



Site created and maintained by Bram
Graphic design by line.out | Server sponsered by fxpansion