PA system

Main Objective

I would like to achieve a public address system (PA system) as to test the ability of the Arduino to process audio signals.

Using the microphone as input, i want to output the speech to the speaker in real time.

Equipment used

-Arduino due
-ADMD401 microphones (input)
-Class D amplifier (connected to the output of arduino)
-Plane wave speaker (connected to Class D amplifier output)

I am currently experiencing issues processing audio signal.

Any idea on how to achieve it ? i Have also attached the

What kind of "processing" do you need to do?

I don't think this a "practical" thing to do, but if you want to do it for fun, or if you need something special that you can't buy, go for it!!!

Have you ever done any DSP (digital signal processing)? ...This is advanced shtuff! If you don't have a DSP book ro a good online reference [u]The Scientist and Engineer's Guide To Digital Signal Processing[/u] by Steven W. Smith is FREE online.

I haven't used the Due, and I don't know how much processing you can do with an 84mHz processor....

I'd recommend you start by generating some tones in software.

Once the output is done, connect a line-level source to the input (you can test the mic preamp separately).

Just pass the input through to the output (analog-to-digital-to-analog). That is, read the ADC into a variable, and write that variable to the DAC (and repeat in a fast-loop, of course). In general, you'll need to read and write at a known-constant sample rate, but as long as the input & output are at the same rate, you should get reasonable results.

Then do some simple DSP such as scaling-down the volume before doing anything "fancy" processing.


Probably the most important thing is to bias the input. The Arduino runs off a single positive voltage and it cannot read the negative half of the audio waveform.

The output also needs to be biased, and then the DC bias voltage needs to be filtered-out (usually with a capacitor) before sending the signal to your power amp.

If you pass-through the biased digital data the output will follow the input and already be biased. But typically, you'll subtract the bias out of the data for processing and add it back before sending the data to the DAC.

The input should have a separate low-pass filter in front of the ADC input to prevent aliasing. (You also need to block the DC bias from going "backwards" into the filter or audio source.)

The output should have a low-pass "smoothing filter". This isn't always 100% necessary because the harmonics are above the audio range (assuming a reasonable sample rate) and the speakers will mechanically filter them out. All proper DACs have a filter, but I had a soundcard that was putting-out "squarish waves" instead of smooth "analog waves". (It sounded OK on my computer speakers.) There is a chance that the harmonics from a non-filtered DAC could screw-up a Class-D amplifier, but a good Class-D amplifier should have it's own filter, or otherwise be able to deal with whatever is fed-in.

DACs and ADCs are integer, but most DSP is done in floating-point. There is lots of summing, multiplication, and division with DSP and you need to handle large temporary values. But, floating-point takes more CPU time. Since the Due is 32-bit and the audio data is 12-bits you may get-by using integers, but that's something you'll have to work-out.

Beware of clipping your ADC or DAC and try to avoid it. If you are reading the ADC at "full volume" (near clipping) and you boost the volume, or boost the bass, or mix two signals, etc., you'll be in danger of clipping the DAC. Monitor your levels (in software) and if you exceed 12-bits, make sure to clip the data instead of allowing it to "roll over". A slight amount of clipping is tolerable... Just 1 bit of rollover sounds terrible!

The Due's ADC & DAC are only 12-bits. That's probably "good enough" for a cheap PA system, but I'm sure you know CDs are 16-bits and no halfway-decent commercial audio product would be less than 16-bits.

JohnLincoln:
It seems to me as though you are wanting to use an Arduino to replace a piece of wire.

Yes, but a wire that adds extra quantization noise, and reduces the frequency response. That is a special sort of wire.

JohnLincoln:
It seems to me as though you are wanting to use an Arduino to replace a piece of wire.

He wants to process the audio.