Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple audio filter-bank

I'm new to audio filters so please excuse me if i'm saying something wrong.

I like to write a code which can split up audio stored in PCM samples into two or three frequency bands and do some manipulation (like modifying their audio levels) or analysis on them then reconstruct audio samples from the output.

As far as i read on the internet for this task i could use FFT-IFFT and do manipulation on the complex form or use a time domain based filterbank which for example is used by the MP2 audio encoding format. Maybe a filter-bank is a better choice, at least i read somewhere it can be more CPU usage friendly in real time streaming environments. However i'm having hard times understanding the mathematical stuff behind a filterbank. I'm trying to find some source code (preferably in Java or C/C++) about this topic, so far with no success.

Can somebody provide me tips or links which can get me closer to an example filter bank?

like image 734
NagyI Avatar asked May 05 '11 17:05

NagyI


People also ask

What is auditory filter bank?

Auditory filter banks are non-uniform bandpass filter banks designed to imitate the frequency resolution of human hearing [308,180,87,208,255]. Classical auditory filter banks include constant-Q filter banks such as the widely used third-octave filter bank.

How many types of filter banks are there?

There are two main types of filter banks. An analysis filter bank and a synthesis filter bank.

What is perfect reconstruction filter bank?

A Perfect Reconstruction (PR) filter bank is any filter bank whose reconstruction is the original signal, possibly delayed, and possibly scaled by a constant [287]. In this context, critical sampling (also called ``maximal downsampling'') means that the downsampling factor is the same as the number of filter channels.

What is subband filtering?

The subband filter is an FIR filter that is applied to the measured signal before synchronization and demodulation in order to minimize the out of band emission and increase the spectrum efficiency.


2 Answers

Using FFT to split an Audio signal into few bands is overkill.

What you need is one or two Linkwitz-Riley filters. These filters split a signal into a high and low frequency part.

A nice property of this filter is, that if you add the low and high frequency parts you get almost the original signal back. There will be a little bit of phase-shift but the ear will not be able to hear this.

If you need more than two bands you can chain the filters. For example if you want to separate the signal at 100 and 2000Hz it would in pseudo-code somewhat like this:

low  = linkwitz-riley-low (100, input-samples)
temp = linkwitz-riley-high (100, input-samples)

mids = linkwitz-riley-low (2000, temp)
highs = linkwitz-riley-high (2000, temp);

and so on..

After splitting the signal you can for example amplifiy the three output bands: low, mids and highs and later add them together to get your processed signal.

The filter sections itself can be implemented using IIR filters. A google search for "Linkwitz-Riley digital IIR" should give lots of good hits.

http://en.wikipedia.org/wiki/Linkwitz-Riley_filter

like image 185
Nils Pipenbrinck Avatar answered Sep 28 '22 02:09

Nils Pipenbrinck


You should look up wavelets, especially Daubechies wavelets. They will let you do the trick, they're FIR filters and they're really short.

Update Downvoting with no explanation isn't cool. Additionally, I'm right. Wavelets are filter banks and their job is to do precisely what is described in the question. IMHO, that is. I've done it many times myself.

like image 28
Phonon Avatar answered Sep 28 '22 03:09

Phonon