Go Down

Topic: Audio exciters driven simultaneously (Read 3332 times) previous topic - next topic

birdm3n

Hi guys, I'm new in using Arduino and I need some help to start my project.

I have to coordinate 5 audio exciters simultaneously. I can't use the function tone() because it would require to use one exciter at the time. Exciters must run all together and must have the same frequency but different amplitude.

Is there someone who can help me in solving this problem?

Thanks in advance!

Grumpy_Mike

Quote
I have to coordinate 5 audio exciters simultaneously.
Can you be more specific here? What I understand as an audio exciters is a tailored transfer function that introduces controlled amounts of harmonics into a sound.

But with you saying:-
 
Quote
I can't use the function tone() because it would require to use one exciter at the time.
It would seem that what you mean by audio exciter is not what I mean by it. So can you point me to the audio exciters you have and say what sort of waveform you need to feed them with?

birdm3n

This is what I consider audio exciter: https://uk.rs-online.com/web/p/speaker-drivers/8765272/

It's an exciter used to make a surface vibrate. I need them to make an object vibrate.

The waveform is not important to me, it can be a sine wave or a square wave, what it is important is that all the 5 exciters emit a signal simultaneously.

DVDdoug

You drive those things with an audio amplifier, and most amplifiers have a volume control.  

You can but some small amplifiers,* or there are lots of amplifier chips if you're up to building them, or you can buy amplifier boards.

Since audio power amplifiers typically have high-impedance inputs (10K or more) the Arduino can drive lots & lots of amplifiers with the same signal at the same time.  (You should put a capacitor in series with the output to filter-out the DC.)

Quote
but different amplitude.
Is it OK to use the amplifier's volume control, or do you need to control the volume with software?   If you need software control you can use digital pots.




* That particular amplifier is sold without a power supply so you have to buy it separately.

Grumpy_Mike

Quote
what it is important is that all the 5 exciters emit a signal simultaneously.
Do these need to be different frequencies?

If so look at this https://www.jeremyblum.com/2010/09/05/driving-5-speakers-simultaneously-with-an-arduino/

Their are many other libraries that do this sort of thing as well. Each speaker will need it's own amplifier, you can not drive these things direct from the Arduino's pins.

birdm3n

Quote
Is it OK to use the amplifier's volume control, or do you need to control the volume with software?
I need to control the volume through software adjusting it according to parameters that are read from other pins.

The signals' frequency is the same for all the signals, the phase and the amplitude are the only things that change from one signal to another.

Is there some kind of problem if I connect all the amplificators to the same pin in order to turn them on?

Quote
If so look at this https://www.jeremyblum.com/2010/09/05/driving-5-speakers-simultaneously-with-an-arduino/
I already found that guide but it uses different frequencies, can I do the same using the same frequency for all the signal, what do you say?

Grumpy_Mike

Quote
I need to control the volume through software adjusting it according to parameters that are read from other pins.

The signals' frequency is the same for all the signals, the phase and the amplitude are the only things that change from one signal to another.
So kind of you to eventually tell us what you need.

So please complete the story and say what you are trying to achieve. That will determine if you need separate amplifiers or not. Only then is it worth finding out a soloution to your real problem.

birdm3n

I'm trying to do an active audio isolation system. The idea is that an exciter emits a sound at a certain frequency and the other 4 cancel the sound wave that arrive near them.

What I need to do is make the 5 exciters run simultaneously producing a signal that is equal in frequency and different in amplitude.
 

Grumpy_Mike

But their is a hell of a lot more to this project than just the vibration generators is their not?

Changing the phase is simple enough but changing the amplitude means an analogue output of some sort. What range of frequencies are we talking about? What sort of Arduino are you thinking of using?

birdm3n

Quote
What sort of Arduino are you thinking of using?
I was thinking to use an arduino pro m0 or an arduino mega 2560, what do you think?

Quote
What range of frequencies are we talking about?
The frequency must be 100Hz as indicated in the project specifics

Grumpy_Mike

I think the M0 would be better than the Mega. However you might be better off with a Teensy3.6, they have a graphics based DSP libiary.
https://www.pjrc.com/teensy/td_libs_Audio.html

Quote
The frequency must be 100Hz as indicated in the project specifics
So is this some sort of assignment then?

birdm3n

Ok thanks! I still haven't understood what is the difference between using a DAC output pin and a PWM output pin using the function analogwrite().

Can you please explain me what's the main difference between them? Which should I use in my project?

Moreover, is the guide that you suggested me still usefull in my case?

Grumpy_Mike

PWM for audio is restricted to 8 bits and you need a filter to smooth the signal. http://www.thebox.myzen.co.uk/Tutorial/PWM.html

So for your project you will need either five timers or a bit of programming. With the D/A you get a pure voltage that needs little or no filtering. However you will need five of them and an M0 or Teensy only has two, so you will need external hardware normally SPI interface.

birdm3n

Perfect! I think I will get an external hardware for the other 3 DAC.

At this point there is just the initial problem to solve, how to emit a signal on all the exciters simultaneously since the function is able to work one instance at a time?

Grumpy_Mike

The link I posted in reply #4 shows you the basics, only instead of toggling a digital pin you maintain a count of how many times you have entered the interrupt routine. That count is restrained to the length of a look up table of your waveform, normally a sin wave. Then the value that the count points to in the look up table is output to the D/A.

To alter the phase you add an offset to the count, to alter the amplitude you multiply the sample you get by a floating point number between zero and one. Each D/A can have its own offset and multiplication factor. That way all the signals are the same frequency but with separate amplitude and phase.

Go Up