Audio equalizer

Moderator: flatmax

Post Reply
Marc_Eberhard
Posts: 3
Joined: Thu Apr 13, 2017 1:00 am

Audio equalizer

Post by Marc_Eberhard » Thu Apr 13, 2017 1:13 am

Hi,

I'm thinking about buying an AudioInjector hat to build an equalizer on a RaspberryPi. Has something like this been done before? The idea is to stream the input into an FFT, multiply with the filter settings and then transform back with an IFFT and output back through the hat. So, the RPi would be an audio device plugged in between the audio source and the amplifier. I'm not planning to use the RPi for any other task to have all computing power available for just that task. Does this sound feasible? Is there example C code available for reading data in from the ADC and writing data out to the DAC? I'm familiar with FFTW, so as long as I can get some simple C code to pipe the input to the output I can do the rest myself. All suggestions and comments greatly appreciated!

All the best,
Marc

flatmax
Posts: 303
Joined: Sat Jul 23, 2016 11:39 pm

Re: Audio equalizer

Post by flatmax » Thu Apr 13, 2017 9:38 am

Sounds like a good plan !

You could use the JackClient with gtkiostream and jackd to do this, check out this example :
http://www.flatmax.org/gtkiostream/html ... ample.html

You can use FFTW with that approach.

Matt
If you have had a positive experience with our products, could you please review them on Amazon - that would be a great help :
https://www.amazon.com/dp/B01HBC8CJ0

Marc_Eberhard
Posts: 3
Joined: Thu Apr 13, 2017 1:00 am

Re: Audio equalizer

Post by Marc_Eberhard » Thu Apr 20, 2017 3:19 am

Hi Matt,

received my audio hat and the output is working fine. The input loops through fine when I use the Output Mixer Line Bypass. Is there an easy way to "digitally" pipe the input through to the output? Like arecord -parameter | aplay -parameters for testing?

Also, had a look at gtkiostream. Looks fine, but I'm worried that the RPi will be too loaded. I'd probably prefer something that doesn't pull in the full GTK suite. JACK and a virtual ALSA device would be ideal I guess. Any idea or links?

Thanks,
Marc

Marc_Eberhard
Posts: 3
Joined: Thu Apr 13, 2017 1:00 am

Re: Audio equalizer

Post by Marc_Eberhard » Thu Apr 20, 2017 3:36 am

Hi Matt,

to answer my first question:

arecord -c 2 -f S32_LE -r 96000 | aplay -c 2 -f S32_LE -r 96000

works fine. Are these the correct parameters, especially S32_LE?

All the best,
Marc

flatmax
Posts: 303
Joined: Sat Jul 23, 2016 11:39 pm

Re: Audio equalizer

Post by flatmax » Thu Apr 20, 2017 9:40 am

Yes - those parameters look good.

Regarding gtkIOStream, they only link against Jackd - so the GTK libs aren't used - actually it is very lightweight, everything happening in libjack, because you only need the header files from gtkiostream for code which links against jackd.

Matt
If you have had a positive experience with our products, could you please review them on Amazon - that would be a great help :
https://www.amazon.com/dp/B01HBC8CJ0

arfbool
Posts: 1
Joined: Wed May 31, 2017 3:30 pm

Re: Audio equalizer

Post by arfbool » Wed May 31, 2017 3:37 pm

Hello,
I'm asking my question in here since it may fall under a similar approach to equalization. I'm looking to use the Audio Injector inside a concert hall to delay the sound to a second set of speakers halfway down the hall as compared to the front. That is, I'd like to take an audio signal, and in real time delay it by a fixed, programmable interval of about 20-30 ms to match the sound coming from the mains. The challenge is that both precise control of the delay and a low-latency buffer is needed.
Any thoughts?
Thanks!
-Scott

flatmax
Posts: 303
Joined: Sat Jul 23, 2016 11:39 pm

Re: Audio equalizer

Post by flatmax » Mon Jun 05, 2017 8:24 pm

You question prompted me to look for an existing simple approach to delay.
From what I see, you can use the upmix alsa plugin to specify a pure delay. I haven't used the upmix plugin, however it allows you to specify a delay in ms.

On your Pi, look at this directory to see if it is installed :

Code: Select all

ls /usr/lib/arm-linux-gnueabihf/alsa-lib/
For example on my system :

Code: Select all

pi@raspberrypi:~ $ ls -l  /usr/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_pcm_upmix.so
-rw-r--r-- 1 root root 9844 Sep  7  2014 /usr/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_pcm_upmix.so
If it is installed, your next challenge will be to craft your .asoundrc file to allow you to specify the use of that plugin.

Here is the documentation for using that plugin.

I guess the trick would be to use that plugin without upmixing and only specifying delay.

Matt
p.s. It would be great if you let us know how you are going.
If you have had a positive experience with our products, could you please review them on Amazon - that would be a great help :
https://www.amazon.com/dp/B01HBC8CJ0

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest