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.

chebyshev waveshaper (using their recursive definition) (click this to go back to the index)<br />

Type : chebyshev<br />

References : Posted by mdsp<br />

Notes :<br />

someone asked for it on kvr-audio.<br />

I use it in an unreleased additive synth.<br />

There's no oversampling needed in my case since I feed it with a pure sinusoid and I control the order to not have frequencies above Fs/2. Otherwise<br />

you should oversample by the order you'll use in the function or bandlimit the signal before the waveshaper. unless you really want that aliasing<br />

effect... :)<br />

I hope the <strong>code</strong> is self-explaining, otherwise there's plenty of sites explaining chebyshev polynoms and their applications.<br />

Code :<br />

float chebyshev(float x, float A[], int order)<br />

{<br />

// To = 1<br />

// T1 = x<br />

// Tn = 2.x.Tn-1 - Tn-2<br />

// out = sum(Ai*Ti(x)) , i C {1,..,order}<br />

float Tn_2 = 1.0f;<br />

float Tn_1 = x;<br />

float Tn;<br />

float out = A[0]*Tn_1;<br />

}<br />

for(int n=2;n

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

Saved successfully!

Ooh no, something went wrong!