Questions regarding FIR filters for real time HRTF filtering

rebillat

Member
Hi all and thanks in advance for your support.

I'm playing with FIR filters using a Teensy 3.6 and I would like to filter in real time a stereo signal using HRTFs (head related transfer functions) that are a way to simulate spatial sound using headphones.

I wrote a Matlab script to export freely available HRTF filters to Teensyduino as FIR filters. Now I'm able to filter in real time stereo music coming to the line in with my left and right HRTF filters and to change the source position (i.e. the FIR) using the potentiometer of the audio board.

But, I still have two issues:
- Why are FIR filters limited to 200 taps? For my application I need linear phase so I need FIR filters but 200 taps is rather short. Is there any simple way to extend that number or is it hardware related?
- How to smoothly transition from one FIR filter to another one? The only way I found is to reset the FIR filter coefficients using FIR.begin(). But it generates an undesirable "click" that I would like to remove. So would it be possible to directly set FIR filter coefficients and to ensure a smooth transition when changing?

I attach a minimum example that is illustrating FIR transition using the included potentiometer similarly to what I would like to achieve.

Many thanks in advance for any advices I could get and I'll be very happy to share the project when working.

Marc
 

Attachments

  • SimpleNoiseFilterFIR.zip
    2.9 KB · Views: 13
Crossfade between the different filters perhaps? Use a mixer object for this.

For large FIR filters FFT-based convolutions become significantly more efficient than brute-force. And for real-time response a partitioned convolution is a good approach - there are various contributions here with code for this, most I believe require a T4 to have enough memory and grunt, the T3.6 is more likely to have throughput limitations.
 
Hi MarkT,

Many thanks for your feedback. I'll try to go through the mixer idea. and I found that project related with FFT-convolution that would allow me to go towards 513 taps:
https://github.com/bmillier/Teensy-FFT-Convolution-Filter

Furthermore I realized that I can also split my HRTFs in a pure delay combined with a FIR filter which can allow me to reduce needed computational resources.

Anyhow, if anyone has more comments or ideas, please let me know.

Marc
 
Back
Top