[music-dsp] minimum samples for lowpass IIR

Marc Poirier destroyfx at smartelectronix.com
Fri Dec 7 21:06:08 EST 2001

Well, you see basically I've got this weird effect & I'm trying to 
make it sound better, but it's killing my CPU with all of the 

Briefly, what this effect (Transverb) does is it has a delay ring 
buffer (adjustable size up to 3 seconds) that gets constantly added 
to by the audio input stream, & then it's got 2 delay heads that read 
from that buffer.  The delay heads are varispeed.  So, right, that 
doesn't really make sense for the delay heads to go at different 
speeds than the writer head because they're going to get all out of 
sync & cross eachother & whatnot, but that's what this effect does. 
And it can produce, in my opinion, a pretty enormous range of amazing 
sounds, so I will defend this weird algorithm to the ground, yes! 
Actually it wasn't even my idea, but my partner's...

Anyway, right now it uses Hermite interpolation for the resampling, 
but downsampling (speeding up) of course becomes harsh-sounding 
because of aliasing, so now I'm adding the lowpass pre-process in 
between the input & the hermite varispeed output.

So here's the problem with lowpassing constantly...  This effect has 
a +6 octave upper maximum for varispeed playback.  That means that 
the readers can pass through the buffer 2^6 times more than the 
writer.  With stereo processing & 2 delay heads, we're looking at an 
upper limit of 2^8 pass through, at 44.1 kHz that means lowpassing 
about 11,000,000 samples per second!  The CPU toll rises 
exponentially as you shift up octaves!  And you see, the delays can 
feedback, so you can't just lowpass the buffer's content on input. 
Anyway, my computer doesn't like this, despite my very efficient 

So you see the conundrum?  If the delay head is moving at a 6 octave 
upshift, that's outputing every 64th sample basically (with 
interpolation of course), but that means I'm processing 64 samples 
only to eventually look at 4 of those during the Hermite 

So anyway, I still don't know if there's a good solution here, maybe 
an FIR, I'm looking into that (thanks to David's helpful info, which 
I'm about to read), we'll see if there's some way that's cheap enough 
& steep enough...  But now you know why I'm trying to cheat.


At 1:51 PM -0800 12/7/2001, Jon Watte wrote:
>Wooah! Hold on there! If you clear the filter between blocks, it
>will not do the right thing. It will introduce potentially terrible
>artifacts. I thought you were talking about the start-up case. You
>cannot take very small blocks of signal and filter them all
>individually and expect to get a coherent whole out of it. The result
>will be as if you filtered each block in the presence of a vacuum,
>and then sliced out the first 32 response frames (including initial
>ringing) and strung them together. Not at all similar to filtering a
>continuous signal.
>If you want to filter a continuous signal, you need to preserve the
>state between blocks. Else it would be like filtering a discontiguous
>signal :-) For an IIR, it's un-clear how much state you need to
>preserve -- after long gaps, it's probably fine to clear it to 0. For
>a FIR, you know exactly how much history to save -- it's the amount
>used by your convolution.
>			/ h+

    [ Destroy FX - http://www.smartelectronix.com/~destroyfx ]

dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links

More information about the music-dsp mailing list