Pages: [1]   Go Down
Author Topic: Audio input to arduino  (Read 1817 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, i want some help regarding the hardware schematic for allowing the audio signal to be splitted into 8 bands then connected to mux then to analog input of arduino (actually making a 8 band spectrum analyzer with a midi controller also).
I have created two schematics in my mind but i m not sure which of them will react better with the analog readings for arduino.

First one:


Second one:


Please note that the op-amp is lm386 and the filters are passive RC filters.
So the basic question is to get the true voltage analog reading for each band, should i shift the signal upwards or rectify it?

For the op-amp should it better be placed before filters or after the mux ?

If i ignored the part of the rectifier/clamper as first stage and just directly connected the audio signal to amplify it first. That means i ll lose the -ve part of the audio signal right?

If i used a Pot with the input as in http://itp.nyu.edu/physcomp/sensors/Reports/CondenserMicrophones this will add a positive DC offset to the audio signal to shift it all upward, i will no longer need the clamper? and if he already shifted it all upwards why did he use the rectifier at the end? ( I understand the he removed DC offset after amplification using the capacitor but he used another voltage divider to shift it up again (correct me if i m wrong.

Would it be better if i used the audio input directly to filters then multiplex them then rectify then amplify?

Sorry if it took so long and sorry for the bad block diagrams...

« Last Edit: August 03, 2011, 06:15:10 pm by Tetsh » Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 29
Posts: 2591
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Please note that the op-amp is lm386 and the filters are passive RC filters.
So the basic question is to get the true voltage analog reading for each band, should i shift the signal upwards or rectify it?
You can't build more or less functional band-pass filter bases on passive RC filters. So , answer is neither.  If you follow idea of the graphic equalizer, you could create 8 pass-band active filters with OPA or transistors as active components, than rectify and filter out outputs.
Quote
and if he already shifted it all upwards why did he use the rectifier at the end?
My guess, it is for educational purposes only. Schematics doesn't have any practical sense.

Other options would be for you, MSGEQ7 chip (7 band, but you can put 2 chips, I think, and get 14 band or so), search for it on a forum or Google, there are a lot of posts.
Or look into software FFT approach:
http://fftarduino.blogspot.com/2011/02/color-organ-spectrum-analyzer-on.html
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why won't the passive filters work? i am just cascading high pass with low pass and i ll pre amplifiy or post amplify
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 29
Posts: 2591
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, first order filters would give you only 6 db/octave, which is too slow. For more complex design, "Twin-T" or Wien bridge problem would still persist, low Q with significant attenuation of the signal.
« Last Edit: August 03, 2011, 09:15:57 pm by Magician » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34243
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That second block diagram is rubbish, you can't filter once you have rectified, I think you are confusing level shifting (which has absolutely no effect on the final result) with rectification.
Quote
and if he already shifted it all upwards why did he use the rectifier at the end?
Because the rectifier gives you an envelope follower where the voltage output is proportional to the peak amplitude which is what you actually want.

just using passive R&C filters will not look any good, you are much better off going with that chip.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@ Magician : Ok i get what you are aiming at but won't the RC filters work for the lower frequencies?

@Grumpy : That chip is actually not available anywhere near me and i ll have to order it online but unfortunally it ll take up to 2 weeks and i m running out of time for this project smiley-sad .

Should Sallen-Key filter solve that problem?
Also, about the attenuation accompanied with the passive filters, can't it be fixed with an op amp and regarding the slow slope/octave should that really be a big problem even if i try to minimize the BW as much as i can ?

Should i use a clamper circuit or a voltage divider to get the signal in the +ve region before amplification? or it won't really matter?

I am also taking the audio output from a line level which as far as i know ranges from -0.707v to 0.707v giving around 1.4v peak to peak and the minimum gain offered by the lm386 is 20 so i can't by anyway scale it from 0 to 5 volts, should i use another op-amp which i have full control on its gain or there is a way to do it around with this chip?

Thanks guys
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34243
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
should i use another op-amp
Yes, that chip is not an op amp.

Use a capacitor in line with the audio input and put it to the junction of a 50:50 potential divider.

If you think the small slope of a first order filter is no problem then you don't understand what you are doing or don't cair what the results look like.

It helps if you fill in your location then we can advise on where to get things from in your part of the world.
Logged

Michigan, United States
Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have used the MSGEQ7 chip. I had a problem with the input signal being to high so you definately want some clamping and attenuation.
However, because of availability, lack of an alternative and the 7 band limits on the chip, I was going to switch to the Arduino FFT library and see how that works. IF it doesn't there are good PIC FFT libraries people are working on.
Logged

Always Think!

0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12200
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The other approach to the problem is to digitize the signal then do the frequency analysis in software using digital filter techniques.

Incidentally 'clamp' means limit to a voltage level, I think the poster meant 'offset' - add a fixed offset voltage.
Logged

[ I won't respond to messages, use the forum please ]

Montreal
Offline Offline
Faraday Member
**
Karma: 29
Posts: 2591
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This should help if you looking for straight forward hardware solution :
http://blog.makezine.com/archive/2010/10/circuit-skills-led-color-organ-spon.html
http://www.waitingforfriday.com/index.php/LED_Colour_Organ
And 8 channel:
http://www3.telus.net/chemelec/Projects/Color-Organ2/ColorOrgan2.png
http://www3.telus.net/chemelec/Projects/Color-Organ2/ColorOrgan2.htm
The same time study FFT in spare moments, you can get astonishing frequency/amplitude resolution (512 band / 15-bit) even on small arduino board.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27143
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think in "exhibits" area, focalist demostrated a 16 or 20 band spectrum analyzer running on arduino and with output displayed on a TV using tvout library. See if you can find that.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks alot guy for the replies the links magician posted were so much helpful.

Would going with a tone decoder like the lm567 should be a bad idea ?

Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 29
Posts: 2591
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not good idea, logic output doesn't provide amplitude data, only present/not present.
Bandwidth 14%, you would need 7 chips just to cover 100 - 200 Hz range.
IC specifically design to detect "known" single frequency, which isn't the case with spectrum analyzers.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i see thanks alot
Logged

Pages: [1]   Go Up
Jump to: