DSPRelated.com
Forums

Best FIR Coefficients for multirate app

Started by Robin Siegemund April 2, 2004
Hello for this newbie question!

I'm on developing a simple audio-sequencer application.
So, if I want to play a 44100Hz samplesound with a default note at D4
like a drum at lower notes like C4,F3,E3,etc., I have to decimate to the
according sampling-rate.
But of course, to prevent aliasing, there must be a lowpass filter before
decimation.
The best way to to this very efficient is an FIR-Filter, so much is clear so
far.

But for this filter, I need for every target-frequence an array of
coefficients with good balanced tap-size.

An array for 128 target-frequencies and e.g. 21 taps would look like this:

float coeff[128][21];

a entry in this field could be (64 is C-5 or similar)

[64][21]={0.2342324f, 0.2463424f,....,0.53223423f}

So, if I have to play a soundsample at C-5, I have to look in my table
at the correspond index (here 64) and use the FIR-Filter with
the coefficients I found here.

Seems to be easy... but where I can get these coefficients for exactly this
application?
These freeware or commercial trial FIR design tools I have seen, can only
output
some coefficients for one target-frequency... but I need about 128 filters,
so
that would be really hard work.

But there are so much audio-sequencers and similar applications on market
and so there should be something like an optimal "downsampling
FIR-coefficient table",
that's good for realtime processing... Or is something like this not
available?

Or how can I calculate such a coefficient-table, without bother myself
with long days in filter design?

Thanks for any help,

Robin Siegemund
"Robin Siegemund" <Robbson@gmx.de> wrote in message
news:4e5c9d28.0404020611.2bb5febd@posting.google.com...
> Hello for this newbie question! > > I'm on developing a simple audio-sequencer application. > So, if I want to play a 44100Hz samplesound with a default note at D4 > like a drum at lower notes like C4,F3,E3,etc., I have to decimate to the > according sampling-rate.
Robin, Maybe I'm not thinking clearly here or don't understand what an audio sequencer is ... but I don't understand how decimation is going to do anything for you. It won't frequency shift one tone down to another. I'm assuming that the input and the output has to be sampled still at 44100Hz - for consistency with the "system". Let's call the sample interval T=1/44100. So, to reduce the frequency of a tone by 2 means you have to: - start with its samples at rate 1/T = 44100. - interpolate those samples by a factor of 2 to get 88200. - play these samples back at 44100 to reduce the frequency by 2. There have to be more samples, not fewer, in order to reduce the frequency for any given sample rate. Next, I have to wonder how you're going to extract these tones in the first place if they are a component part of the audio. They would have to be - detected - extracted then processed...... Fred
Hey,

Matlab is a good tool for something like this.  You can write a matlab
program to call matlab's built in filter design functions in a loop,
changing the cutoff frequencies on each loop iteration, and output the
results to a text file for later import into a C file.

I actually did something similar to generate a text file that was later read
in by another program on initialization.  Changing the cutoffs/number of
frequencies/number of coeffs/ was then easily adjustable within the matlab
program...

Cheers,

Chris

"Robin Siegemund" <Robbson@gmx.de> wrote in message
news:4e5c9d28.0404020611.2bb5febd@posting.google.com...
> Hello for this newbie question! > > I'm on developing a simple audio-sequencer application. > So, if I want to play a 44100Hz samplesound with a default note at D4 > like a drum at lower notes like C4,F3,E3,etc., I have to decimate to the > according sampling-rate. > But of course, to prevent aliasing, there must be a lowpass filter before > decimation. > The best way to to this very efficient is an FIR-Filter, so much is clear
so
> far. > > But for this filter, I need for every target-frequence an array of > coefficients with good balanced tap-size. > > An array for 128 target-frequencies and e.g. 21 taps would look like this: > > float coeff[128][21]; > > a entry in this field could be (64 is C-5 or similar) > > [64][21]={0.2342324f, 0.2463424f,....,0.53223423f} > > So, if I have to play a soundsample at C-5, I have to look in my table > at the correspond index (here 64) and use the FIR-Filter with > the coefficients I found here. > > Seems to be easy... but where I can get these coefficients for exactly
this
> application? > These freeware or commercial trial FIR design tools I have seen, can only > output > some coefficients for one target-frequency... but I need about 128
filters,
> so > that would be really hard work. > > But there are so much audio-sequencers and similar applications on market > and so there should be something like an optimal "downsampling > FIR-coefficient table", > that's good for realtime processing... Or is something like this not > available? > > Or how can I calculate such a coefficient-table, without bother myself > with long days in filter design? > > Thanks for any help, > > Robin Siegemund
try this freeware

http://winfilter.20m.com


Robin Siegemund wrote:
> Hello for this newbie question! > > I'm on developing a simple audio-sequencer application. > So, if I want to play a 44100Hz samplesound with a default note at D4 > like a drum at lower notes like C4,F3,E3,etc., I have to decimate to the > according sampling-rate. > But of course, to prevent aliasing, there must be a lowpass filter before > decimation. > The best way to to this very efficient is an FIR-Filter, so much is clear so > far. > > But for this filter, I need for every target-frequence an array of > coefficients with good balanced tap-size. > > An array for 128 target-frequencies and e.g. 21 taps would look like this: > > float coeff[128][21]; > > a entry in this field could be (64 is C-5 or similar) > > [64][21]={0.2342324f, 0.2463424f,....,0.53223423f} > > So, if I have to play a soundsample at C-5, I have to look in my table > at the correspond index (here 64) and use the FIR-Filter with > the coefficients I found here. > > Seems to be easy... but where I can get these coefficients for exactly this > application? > These freeware or commercial trial FIR design tools I have seen, can only > output > some coefficients for one target-frequency... but I need about 128 filters, > so > that would be really hard work. > > But there are so much audio-sequencers and similar applications on market > and so there should be something like an optimal "downsampling > FIR-coefficient table", > that's good for realtime processing... Or is something like this not > available? > > Or how can I calculate such a coefficient-table, without bother myself > with long days in filter design? > > Thanks for any help, > > Robin Siegemund