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.

frequency warped FIR lattice (click this to go back to the index)<br />

Type : FIR using allpass chain<br />

References : Posted by mail[AT]mutagene[DOT]net<br />

Notes :<br />

Not at all optimized and pretty hungry in terms of arrays and overhead (function requires two arrays containing lattice filter's internal state and ouputs<br />

to another two arrays with their next states). In this implementation I think you'll have to juggle taps1/newtaps in your processing loop, alternating<br />

between one set of arrays and the other for which to send to wfirlattice).<br />

A frequency-warped lattice filter is just a lattice filter where every delay has been replaced with an allpass filter. By adjusting the allpass filters, the<br />

frequency response of the filter can be adjusted (e.g., design an FIR that approximates some filter. Play with with warping coefficient to<br />

"sweep" the FIR up and down without changing any other coefficients). Much more on warped filters can be found on Aki Harma's website<br />

( http://www.acoustics.hut.fi/~aqi/ )<br />

Code :<br />

float wfirlattice(float input, float *taps1, float *taps2, float *reflcof, float lambda, float *newtaps1,<br />

float *newtaps2, int P)<br />

// input is filter input<br />

// taps1,taps2 are previous filter states (init to 0)<br />

// reflcof are reflection coefficients. abs(reflcof) < 1 for stable filter<br />

// lamba is warping (0 = no warping, 0.75 is close to bark scale at 44.1 kHz)<br />

// newtaps1, newtaps2 are new filter states<br />

// P is the order of the filter<br />

{<br />

float forward;<br />

float topline;<br />

forward = input;<br />

topline = forward;<br />

for (int i=0;i

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

Saved successfully!

Ooh no, something went wrong!