[sdiy] Looking for cheap lowpass filter algorithm

Magnus Danielson cfmd at bredband.net
Wed Aug 16 15:47:15 CEST 2006


From: Seb Francis <seb at burnit.co.uk>
Subject: [sdiy] Looking for cheap lowpass filter algorithm
Date: Wed, 16 Aug 2006 14:35:29 +0100
Message-ID: <44E31F21.3060308 at burnit.co.uk>

Seb,

> I'm looking for a very simple algorithm to achieve the following ...
> 
> With a digital delay running at 48kHz sampling rate I want to have the 
> option to double the delay time by discarding half the data (i.e. have a 
> 24kHz sampling rate)
> 
> It works fairly well just storing every other input sample, then 
> interpolating between samples to generate the missing output samples.  
> However high frequencies (e.g. 'S' sounds in speech) come out quite 
> distorted.
> 
> So I'm looking for a cheap way in software to filter the high 
> frequencies to make the distortion less noticeable.  Any pointers?

You want to lowpass filter your signal in 48 kHz with a lowpass-filter having
the cut-off just below 12 kHz and a fairly steep slope such that above 12 kHz
you have an effective stop-band. A FIR filter will do this for you and you can
get linear phase very easilly. Then taking every other sample isn't as grave an
error as it is now.

If you don't do this, you will have overtones being twisted around 12 kHz down
into the audioble spectrum since taking every other sample is the equalent to
sampling at 24 kHz giving it the new Nyquist frequency at 12 kHz.

Good luck!

Cheers,
Magnus



More information about the Synth-diy mailing list