Go Down

Topic: can an Arduino be used as an active audio equalizer? (Read 9312 times) previous topic - next topic

PNO3

As a learning exercise, I wanted to build a system that would take analog audio, convert it into a digital signal, preform audio equalizer functions, then convert it back to analog and feed it into an amplifier. I have built analog equalizers before, much like the one on:
 (http://www.eleccircuit.com/5-channel-graphic-equalizer-by-bc548-transistor/) 
I now wish do preform the same function digitally however. My first question, is this possible to do on an Arduino? I have never used an Arduino before, and am not sure if they have enough power for this kind of task. I have done some research and found that most models of Arduino only have 10 bit ADC. I have found pages like this one :(https://www.adafruit.com/products/1085)
that build external ADC cards that work with Arduino, are these cards better for this taks? It also appears that there is a big difference in power between different Arduino models. The Arduino Due runs a 32 bit 82 MHz processor, while the Arduino ZERO runs a 32-bit 48 MHz processor, so Is there a specific Arduino that is most suited to the job?

DVDdoug

I'm not sure...   I'd look for something else...   Most Arduino's don't have a DAC.

You might try a Raspberry Pi.   It's got a "soundcard".    And, with an operating system it should be easier to program (although a multitasking operating system means you need buffers which add delay).

There are also specialized DSP chips, but I don't know how easy it is to find a hobbyist-friendly one.

PNO3

I'm not sure...   I'd look for something else...   Most Arduino's don't have a DAC.

You might try a Raspberry Pi.   It's got a "soundcard".    And, with an operating system it should be easier to program (although a multitasking operating system means you need buffers which add delay).

There are also specialized DSP chips, but I don't know how easy it is to find a hobbyist-friendly one.
thanks for the reply. I did look into other chips, and one that looked quite promising was the ADAU1701 as part of the free DSP project. (http://www.freedsp.cc/)
I can't seem to be able to simulate that chip however, and without simulation, (if it turns out anything like some of my other projects) I am sure I will destroy quite a number of them before I get it correct. A system like Arduino appears to be easy to simulate, and I get an excuse to learn how to use an Arduino. If its not possible with an Arduino however, then I will have to go back to google and find a chip I can simulate in Pspice, Xilinx, Quartus, etc.....) The newer Arduino do not have DAC?

Grumpy_Mike

Quote
The newer Arduino do not have DAC?
No.
Also the sample rate is not so good either. Try and ween yourself off simulators. I have never used them.
An all software solution could involve an FFT, some scaling of bin contents and then an inverse FFT again. This is very processor intensive, and the only things you have a hope of doing that with in this family is e Zero, Due or teensey.

pjrc

The Teensy Audio Library can probably help you with this.  You'll probably want to get the new Teensy 3.6 for more processing power if you wish to implement a large number of bands.

FFT is probably not a good approach.  The idea is seductive: just turn the samples into frequencies, adjust them, and then use inverse FFT to turn back to time domain samples.  But FFT works in blocks, giving you the spectrum as if the signal within the block repeats infinitely.  Music changes, rather than repeating waveforms for long times, where those variations over time are what creates the musically pleasing qualities we humans perceive.  Discontinuities at the block boundaries tend to become audible artifacts, no matter how well the FFT works within each block.  Those artifacts can sound pretty terrible.

The common approach is to run the audio into many bandpass filters.  Then adjust the gain of each, and sum them back to form the output signal.  If using FIR filters, you might also add delay elements on the higher bands.  The audio library has all these features in the design tool, so you can just drag the input, filters, mixers and output onto the canvas, wire them up, export code into Arduino, and add just a bit of code to read pots or sensors and alter the mixer channel gains while the library processes sound.

This tutorial (31 page PDF, or 48 minute video) is the place to start, if you're not familiar with the system.  It's very easy to use with the design tool and small amounts of Arduino code to control the audio objects.

AbolfazlNejatian

Hey everyone
I'm gonna build up a PC speaker with Arduino, and my desired speaker detailed as follows:

   1.   3.5 mm jack, Bluetooth and USB as an input section.
   2.   I need to make some process on my input signal (FFT and cross-correlation) in order to create visual EQ on LCD, Reinforcing/Weakening some signal's frequency in case of need and pass signal throw an adaptive noise cancellation like RLS (or LMS algorithm in the case of memory shortage) and a vocal commander, turn on/down volume, next/previous and pause/stop command with voice command.(it's totally depend on the processing speed and memory, I doubt Arduino can handle it  :cry: )
   3.   And in output section, two approximately 60 Watt speakers (I don't know which one is more accurate!!! two mono amplifier or one stereo amplifier.)

So gimme your point of views about it and its Strengths/weak points.
I did a lot of DSP works in MATLAB environment and I know about the basis of signal processing but I don't know about the feasibility of run it on Arduino.
And would you please recommend your intended module for section one and three of my question.

pjrc

Wow, that's a pretty incredible feature list.  Any idea what algorithm might be used for the "vocal commander" to recognize words?

Go Up