Digital room correction solution - FPGA

Hi to everyone!

I want to complete my digital room correction solution (also can be used as active digital filter, crossover).
What is - Room or loudspeaker correction and why we would care about it?
First point every loudspeaker setup can’t produce equal sound pressure in all audio frequencies.
loudspeaker_spl.png
Second point if You have multi way loudspeaker system then mostly You will have passive crossovers what introduces phase shifts.

To overcome these problems we can use active digital filters to correct these errors.
corrected_loudspeaker.png
Little bit theory about digital filter and requirements for such system.
First of all You need to choose one sample rate or else, every time You switch the sample rate You need to modify filter impulse response.
Second You need to know (understood) correlation between chosen sample rate and FIR filter length.
Simple equation for that is Fres = Sample rate / FIR Filter length. Fres is frequency resolution, for instance if You have 96kHz sample rate and 1024 Filter length then You will be able to correct frequencies with 96000/1024 = 93.75 resolution. As You can see frequency response at the low end is not enough.
Third point. Delay introduced by FIR filter. If You are using linear phase FIR filter Your output delay will be half of a chosen filter length multiplied by 1/sample rate.

I designed and tested such solution on FPGA based system (no CPU, only digital logic).
So what did I get - first prototype!:
*) FPGA - Cyclone III
*) FT2232 - communication with PC - load filter responses
*) up to 8192 FIR filter for each channel, can be increased
*) supports up to 96kHz sample rate, can be increased
*) desired impulse response can be imported from PC - for both channels separately
*) board have i2s input and output no additional converters are needed
*) computation is done on full precision

In picture below You can see high level block diagram

audio_filter_fpga.jpg

Multiplexers are placed to add more robust features, for instance splitting one channel data to more - useful when creating active crossover system.

To-Do list:
*) Learn how to control GPIO in RB Pi. Work with Python;
*) Design program which sends impulse response from RB Pi directly to FPGA;
*) IFFT implementation to calculate desired impulse response;
*) Some nice way to get measured data in RB Pi from loudspeaker;
*) GUI interface for creating/controlling FPGA?
*) New hardware design with more robust FPGA

If some points are not enough clearly explained, let me know, I will try to explain!

-Rinalds

Very interesting ! Just some info about different things about drc with a raspebrry (or probably other device) : dsp-with-raspberry-hifiberry-and-volumio-drc-folve-t672.html
I test it, but with a poor microphone… so with a poor result…

Hi Rinalds,

That looks great! I have been using software convolution and filters (jconvolver, zita-lrx) on the CPU, but the FPGA offers much better DSP performance right? I’m interested in the latency, for use in active crossover systems.

I think having the filter generation/ customization accessible from the webUI, but actual DSP being done on the FPGA, to be the best of both worlds. Similar to MiniDSP, but better integration since one is always connected to the other.

Keep us posted on your efforts! For myself, multichannel is the key…

Best,
Mike

Oh, and what do you think of this idea? Interesting DAC that plans to integrate crossover filters: soekris.com/products/audio-prod … m1021.html

Hey

It’s been a while, but I have some progress, regarding to digital room correction.
First of all I have completed DAC, with resampler board from twistedpearaudio - Metronome ASRC.
Also I bought SPL meter from miniDSP.

What did I got
Measured uncorrected SPL from my bookshelf speakers - Dali Zensor 1
uncorrected_Dali_Zensor_1.jpg

And corrected SPL AFR with FIR filters
corrected_Dali_Zensor_1.jpg

Future work is to improve software what calculates FIR filter coefficients - SPL log conversion to linear (frequncy and SPL values).

I’m using REW EQ softwre