Karlsen Filter

Sound synthesis techniques, DSP and related mathematics

Moderators: electrogear, exonerate

Karlsen Filter

Postby Eska on Sun Nov 25, 2007 3:27 am

Ove Karlsen lowpass from the music-dsp archive.
http://www.esnips.com/doc/bd44d12d-313d-4c05-aae0-fce8f751f5bc/Karlsen-filter

skol
User avatar
Eska
essemist
 
Posts: 168
Joined: Mon Oct 17, 2005 3:15 pm
Location: Vienna

Re: Karlsen Filter

Postby TomC on Sun Nov 25, 2007 10:35 am

Eska wrote:Ove Karlsen lowpass from the music-dsp archive.
http://www.esnips.com/doc/bd44d12d-313d-4c05-aae0-fce8f751f5bc/Karlsen-filter

skol


"The requested resource (/doc/bd44d12d-313d-4c05-aae0-fce8f751f5bc/Karlsen-filter) is not available."

Tom
.signature failure
User avatar
TomC
smanatic
 
Posts: 706
Joined: Tue Oct 02, 2007 9:34 pm
Location: 3rd rock from the sun

Postby Eska on Sun Nov 25, 2007 2:51 pm

Mhh..No problem here (with firefox2).
User avatar
Eska
essemist
 
Posts: 168
Joined: Mon Oct 17, 2005 3:15 pm
Location: Vienna

Postby sunsynth on Sun Nov 25, 2007 3:06 pm

Thanks 4 sharing Eska...

btw: DL works with IE but not with my Opera...

SUNsynth
User avatar
sunsynth
smaniac
 
Posts: 1494
Joined: Mon Sep 11, 2006 3:27 pm
Location: HH - Made in Germany

Postby TomC on Sun Nov 25, 2007 5:42 pm

sunsynth wrote:Thanks 4 sharing Eska...

btw: DL works with IE but not with my Opera...

SUNsynth


Works here now, too.


Tom
.signature failure
User avatar
TomC
smanatic
 
Posts: 706
Joined: Tue Oct 02, 2007 9:34 pm
Location: 3rd rock from the sun

Postby infuzion on Thu Nov 29, 2007 8:54 am

Nifty! What is the advantage of using this filter compared to others?
Boosting the Res high seems to make the filter fold over itself.

BTW, SM will round off "2*(PI)3.14159265358979*10000" to 62831.9
Helps with the Res folding slightly, so there you have it.

edit: looking at your Code, I see this:
Code: Select all
streamin in;
streamin cutoff;
streamin q;
streamin cor;
streamin f;
streamin track;
streamout out;
float resoclip,buf1,buf2,buf3,buf4,cut,res;
//cor=2*(PI)3.14159265358979*10000/sr;
cut=max ((f*track+cutoff)*cor,0);
cut=min (cut,0.7);
res=3*q;

resoclip = buf4;
resoclip = min(resoclip,1);
resoclip = max(resoclip,-1);
in = in - (resoclip * res);
buf1 = ((in - buf1) * cut) + buf1;
buf2 = ((buf1 - buf2) * cut) + buf2;
buf3 = ((buf2 - buf3) * cut) + buf3;
buf4 = ((buf3 - buf4) * cut) + buf4;

resoclip = buf4;
resoclip = min(resoclip,1);
resoclip = max(resoclip,-1);
in = in - (resoclip * res);
buf1 = ((in - buf1) * cut) + buf1;
buf2 = ((buf1 - buf2) * cut) + buf2;
buf3 = ((buf2 - buf3) * cut) + buf3;
buf4 = ((buf3 - buf4) * cut) + buf4;
out = buf4;
Is the second section a way to cascade filters, or did you accidentally copy & pasted twice?
Need help? First search the forum & WiKi, then post in the help forum with a clear topic, request, & OSM. Then please WiKi the correct solution. If you want my personal assistance, I charge by the hour or for an exchange of services.
infuzion
smstar
smstar
 
Posts: 6163
Joined: Wed May 04, 2005 8:02 pm
Location: Earth, USA, CO, Denver

Postby rl on Thu Nov 29, 2007 9:39 am

Guess it's ment to be 2x oversampling.
User avatar
rl
dsp wiz
 
Posts: 1494
Joined: Mon Feb 07, 2005 10:24 pm
Location: de.earth.universe.known

Postby Eska on Thu Nov 29, 2007 3:33 pm

Thx RL. I think it`s oversampling. Sounds nice for the load anyway.
User avatar
Eska
essemist
 
Posts: 168
Joined: Mon Oct 17, 2005 3:15 pm
Location: Vienna

Postby infuzion on Thu Nov 29, 2007 4:33 pm

rl wrote:Guess it's ment to be 2x oversampling.
Hmmm. I thought oversampling took two calculations & averaged the 2? This code re-uses the old variables (buf1-4), keeping their old values, so it looks like cascading to me. Maybe I don't understand oversampling.
Need help? First search the forum & WiKi, then post in the help forum with a clear topic, request, & OSM. Then please WiKi the correct solution. If you want my personal assistance, I charge by the hour or for an exchange of services.
infuzion
smstar
smstar
 
Posts: 6163
Joined: Wed May 04, 2005 8:02 pm
Location: Earth, USA, CO, Denver

Postby Eska on Thu Nov 29, 2007 5:43 pm

For shure it is me.:-) Thank you for explanation.
User avatar
Eska
essemist
 
Posts: 168
Joined: Mon Oct 17, 2005 3:15 pm
Location: Vienna

Postby exonerate on Thu Nov 29, 2007 6:01 pm

infuzion wrote:
rl wrote:Guess it's ment to be 2x oversampling.
Hmmm. I thought oversampling took two calculations & averaged the 2? This code re-uses the old variables (buf1-4), keeping their old values, so it looks like cascading to me. Maybe I don't understand oversampling.


yeah it's cascaded, i though it was oversampling at first but it's not.

If you comment out the second part, you can clearly hear it has less steep a cutoff.

The track knob on this doesn't seem to 'track' at all in fact i need to have that at zero for the cutoff knob to even work. :S

I'm going to have a play with it now, most likely I'll change it so the filter is set out like the state variable (using pitch to freq ect..) so that it can just be dropped inside the SV filter.

cheers ;)

Exo
The Developer Toolkit -- A collection of over 150 modules and counting. Available from the Registered Users forum.
User avatar
exonerate
smaniac
 
Posts: 1487
Joined: Sat Dec 30, 2006 1:57 pm
Location: England, West Yorkshire, Huddersfield

Postby infuzion on Thu Nov 29, 2007 9:35 pm

exonerate wrote:I'm going to have a play with it now, most likely I'll change it so the filter is set out like the state variable (using pitch to freq ect..) so that it can just be dropped inside the SV filter.
That is a cool idea!
TIA
Need help? First search the forum & WiKi, then post in the help forum with a clear topic, request, & OSM. Then please WiKi the correct solution. If you want my personal assistance, I charge by the hour or for an exchange of services.
infuzion
smstar
smstar
 
Posts: 6163
Joined: Wed May 04, 2005 8:02 pm
Location: Earth, USA, CO, Denver

Postby exonerate on Thu Nov 29, 2007 10:12 pm

ok here is my state variable compatible version :)

http://www.box.net/shared/xh9oa42976

It only needed a slight modification for it to work inside the SV filter,

And now the track knob works :D

When i get a chance i might take a look over at the dsp archive and see if theres any more filters that need SM'ing ;)

---edit--- forgot to mention i turned the resonance down slightly, 'q' was multipied by 3, i just changed that to 2.5, i think it sounds a bit better.

cheers ;)

Exo
The Developer Toolkit -- A collection of over 150 modules and counting. Available from the Registered Users forum.
User avatar
exonerate
smaniac
 
Posts: 1487
Joined: Sat Dec 30, 2006 1:57 pm
Location: England, West Yorkshire, Huddersfield

Postby infuzion on Thu Nov 29, 2007 11:06 pm

exonerate wrote:ok here is my state variable compatible version :)
http://www.box.net/shared/xh9oa42976
...
---edit--- forgot to mention i turned the resonance down slightly, 'q' was multipied by 3, i just changed that to 2.5, i think it sounds a bit better.
That's handy, thanks! Had to install the .9 beta though to open it.

Doing an A/B of the other LP filter, the Karlsen seems much quieter. I think maybe it is the res multiplication; in the SV version, the res code is:
Code: Select all
rez = 1.0 - resonance;
WhenI change the Karlsen code to
Code: Select all
res=.3*q;
it is much louder.
Need help? First search the forum & WiKi, then post in the help forum with a clear topic, request, & OSM. Then please WiKi the correct solution. If you want my personal assistance, I charge by the hour or for an exchange of services.
infuzion
smstar
smstar
 
Posts: 6163
Joined: Wed May 04, 2005 8:02 pm
Location: Earth, USA, CO, Denver

Postby exonerate on Thu Nov 29, 2007 11:14 pm

That's handy, thanks! Had to install the .9 beta though to open it.


doh!! i keep forgetting I'm using the beta version. :blush:

cheers ;)

Exo [/url]
The Developer Toolkit -- A collection of over 150 modules and counting. Available from the Registered Users forum.
User avatar
exonerate
smaniac
 
Posts: 1487
Joined: Sat Dec 30, 2006 1:57 pm
Location: England, West Yorkshire, Huddersfield

Next

Return to Sound

Who is online

Users browsing this forum: No registered users and 2 guests