In pd 0.47.1 [hip~] is still not perfect. Attenuation at cutoff is not constant over the frequency range: -6 dB with cutoff=SR/8, -3 dB with cutoff=SR/4, 0 DB with cutoff=SR/2. In contrast, iemlib's [hp1~] has -3 dB at cutoff consistently.
Could vanilla pd implement iemlib's hipass filter recipe? I don't know if the license also covers the math. Documentation in https://git.iem.at/pd/iemlib/tree/master points to external literature for part of the math (bilinear transform). I've implemented the recipe with vanilla objects for comparison, see attached. Katja
#N canvas 432 238 483 402 10; #X obj 47 130 hip~; #X obj 48 164 env~ 8192; #X obj 46 83 osc~; #X obj 90 21 hsl 200 15 0 22000 0 0 empty empty frequency 20 8 0 10 -262144 -260097 -1 100 1; #X floatatom 48 201 5 0 0 0 - - -, f 5; #X msg 389 21 \; pd dsp 1; #X msg 390 69 \; pd dsp 0; #X obj 212 165 env~ 8192; #X floatatom 212 203 5 0 0 0 - - -, f 5; #X floatatom 87 57 8 0 0 0 - - -, f 8; #X text 79 130 vanilla built in; #N canvas 38 147 451 560 hip~ 0; #X obj 40 25 inlet~; #X obj 41 468 outlet~; #X floatatom 225 448 8 0 0 0 - - -, f 8; #X floatatom 122 401 8 0 0 0 - - -, f 8; #X text 120 418 normalisation; #X obj 225 361 - 1; #X obj 252 361 + 1; #X obj 225 334 t f f; #X obj 225 425 /; #X obj 149 358 + 1; #X obj 122 334 t f f; #X obj 122 375 /; #X obj 41 392 *~ 0; #X obj 41 442 rpole~; #X obj 100 13 cnv 15 300 300 empty empty empty 20 12 0 14 -233017 -66577 0; #X obj 122 222 cos; #X obj 122 194 t f f; #X obj 149 222 sin; #X obj 122 251 /; #X floatatom 166 268 8 0 0 0 - - -, f 8; #X obj 306 113 atan; #X msg 306 86 1; #X obj 122 26 inlet; #X floatatom 306 168 8 0 0 0 - - -, f 8; #X obj 137 65 samplerate~; #X obj 122 95 /; #X obj 306 48 loadbang; #X obj 306 139 * 4; #X obj 122 156 *; #X floatatom 155 96 8 0 0 0 - - -, f 8; #X floatatom 165 173 8 0 0 0 - - -, f 8; #X text 223 269 cot(pi*f(0)/SR); #X text 222 172 pi*f(0)/SR; #X text 361 168 pi; #X text 161 26 cut off frequency f(0); #X text 226 468 feedback coefficient; #X obj 41 352 rzero~ 1; #X text 39 502 filter recipe of [iemlib/hp1~] \, see documentation by Thomas Musil: https://git.iem.at/pd/iemlib/tree/master; #X connect 0 0 36 0; #X connect 5 0 8 0; #X connect 6 0 8 1; #X connect 7 0 5 0; #X connect 7 1 6 0; #X connect 8 0 2 0; #X connect 8 0 13 1; #X connect 9 0 11 1; #X connect 10 0 11 0; #X connect 10 1 9 0; #X connect 11 0 3 0; #X connect 11 0 12 1; #X connect 12 0 13 0; #X connect 13 0 1 0; #X connect 15 0 18 0; #X connect 16 0 15 0; #X connect 16 1 17 0; #X connect 17 0 18 1; #X connect 18 0 19 0; #X connect 18 0 10 0; #X connect 18 0 7 0; #X connect 20 0 27 0; #X connect 21 0 20 0; #X connect 22 0 25 0; #X connect 24 0 25 1; #X connect 24 0 29 0; #X connect 25 0 28 0; #X connect 26 0 24 0; #X connect 26 0 21 0; #X connect 27 0 23 0; #X connect 27 0 28 1; #X connect 28 0 30 0; #X connect 28 0 16 0; #X connect 36 0 12 0; #X restore 212 129 pd hip~; #X obj 130 165 env~ 8192; #X floatatom 130 202 5 0 0 0 - - -, f 5; #X obj 48 232 -; #X floatatom 48 267 5 0 0 0 - - -, f 5; #X obj 212 233 -; #X floatatom 212 267 5 0 0 0 - - -, f 5; #X text 88 269 dB; #X text 249 267 dB; #X text 75 83 test signal; #X text 46 350 Katja Vetter Oct. 2016; #X text 262 129 recipe from iemlib; #X text 138 58 Hz; #X text 45 309 Test hipass filter attenuation at cutoff frequency. Output should be -3dB at cutoff over the entire frequency range.; #X connect 0 0 1 0; #X connect 1 0 4 0; #X connect 2 0 0 0; #X connect 2 0 11 0; #X connect 2 0 12 0; #X connect 3 0 9 0; #X connect 4 0 14 0; #X connect 7 0 8 0; #X connect 8 0 16 0; #X connect 9 0 2 0; #X connect 9 0 0 1; #X connect 9 0 11 1; #X connect 11 0 7 0; #X connect 12 0 13 0; #X connect 13 0 14 1; #X connect 13 0 16 1; #X connect 14 0 15 0; #X connect 16 0 17 0;
_______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list