Home made spectrum analyzer

russo

Member
2008-01-21 2:40 am
Coimbra
Good night every one, can someone teach me a little about spectrum analyzers, I would love to make a "simple" one, something like 20 bands or so in the 20hz to 20Khz range, no need to be accurate, just for light show purposes.
I think that I can do it using 20 band-pass filters, but the first question is what frequencies should I use to do that, and what type of filter should I use and what op-amps as I want the filter to be digital, then how can I make an audio signal to become a single ended signal(0-5v) so I can read it using an adc and one micro-controller.
I have already took a look at the old GK thread about his homebrew spectrum analyser but there is no information about the filters but it looks like he used band-pass filters.
 

russo

Member
2008-01-21 2:40 am
Coimbra
I just love hardware, and light shows too, but that's another story.
Looks like that site helps a bit, thanks for sharing.
I'm an EE student but due to the nature of my university I have to learn a lot of maths and there is little pratical classes, so if I want to learn even more DIY is the way to go.
From this old thread:
http://www.diyaudio.com/forums/soli...digital-sampling-audio-spectrum-analyser.html

Created by GK as said earlier I read this:
Attached below is a photo of how far I got this weekend. Shown is the digital section of the unit plugged into a SVGA monitor. The photo didn’t come out very well due to the camera flash, but the early stages of the generated display can be seen.

The digital board has an analogue multiplexer with 20 voltage inputs (one for each frequency band). Each input will be fed from a simple half wave peak detector preceded by a two stage MF bandpass filter.
I haven’t built the analogue/filter board yet. In the photo below I am just feeding one of the analogue inputs from the wiper of a potentiometer wired across the supply rails.
The variable voltage from this potentiometer is producing the yellow level bar that can be seen on the screen.

The white graticule can also be seen. The graticule currently fills the entire screen without a border, as I haven’t finished soldering in the vertical and horizontal video blanking logic yet.
When finished the graticule displayed on screen will be comprised of just the 20 by 10 square grid pattern as described in the previous post.

So, now seems like I should search how peak detector work, I think that is just using a comparator and compare the output of each bandpass filter with some defined treshold, i'm I right?
 

russo

Member
2008-01-21 2:40 am
Coimbra
As an atmel user I already know this fft engine for atmel micro-controllers:
ELM - Audio Spectrum Monitor

But I would love to make first a hardware version and then an fft based one, as I dont really really understand fft's, I know what they are, but never played with then in an pc to extract their juice to be efficient in a small 8 bit uC.
I know I am being a bit stubborn with this, but I love big graphic equalizers, mixing tables with tons of channels, sliders and knobs, dmx controllers and the like and making one "spectrum analyzer" using just hardware and a little help from an uC would make me very very happy.
 
You should be able to find all sorts of switched capacitor filter chips for the bandpass filters. I think there was a 1/3 octave triple; not sure if its current; something 380? I'd hold the output briefly with a cap and scan all the filters with an ADC and a PIC chip or something, then use that to drive the multiplexed multiple bar graph displays. The whole mess gets out of control if you try to have dedicated circuitry for each band, but that's how people used to do it. I'm pretty sure these projects were published multiple times in the popular electronics magazines, all long gone.
 

russo

Member
2008-01-21 2:40 am
Coimbra
I have a bunch of programmable switched cap filters from maxim, maybe its time to do some reading about how to use then, so the way is to use bandpass filters and read the values using an adc.
One more thing, how to use op-amps to convert the positive and negative voltage from an audio signal to a only positive signal?
I have already searched about this theme in the web, but I cant find anything.
 
all you need to do is build a precision rectifier (op amp and diode(s)) for each one.

you can get a little chip called MSGEQ7 which does 7 bands of spectrum analysis with just an 8 pin IC (you can get smd version from BlipTronics.com but i got DIP version from china for $3 each UTSOURCE.NET

you could use 3 of them and change the clock frequencies on the other 2 to get 21 bands.

the output is multiplexed and by a clock, but its quite easy to set up. i made a big VU meter which has 6 overlapping bands of different color (for spectrum) on RGB LEDS with just that IC, an arduino, and some serial controlled RGB LEDS. (also from bliptronics)

I expect you could use a display like this
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1254359561
but input the values from the ICs instead of a computer.
 
Last edited:
Thanks for the help to all the posters!! :)
I know that MSEGQ7 chip and I'm also an arduino forum user and already know that nice post, but I want something different.
I know that all this "requirements" may seem strange but I would like to make this using op-amps or switched caps as an learning exercise about analogic electronics.
That spectrum analyser is way over the top, very nice, but I can convert it to only work at audio frequencies.
I have allready read this nice topic, and this is what trigered my will to make this an analogic/discrete piece of hardware:
http://www.diyaudio.com/forums/soli...digital-sampling-audio-spectrum-analyser.html
Its a pitty that there is no info about the op-amp filters.
Gonna google a bit more.
 
Last edited:

scott wurcer

Disabled Account
2004-01-26 3:03 pm
Belmont MA
Thanks for the help to all the posters!! :)
I know that MSEGQ7 chip and I'm also an arduino forum user and already know that nice post, but I want something different.
I know that all this "requirements" may seem strange but I would like to make this using op-amps or switched caps as an learning exercise about analogic electronics.
That spectrum analyser is way over the top, very nice, but I can convert it to only work at audio frequencies.
I have allready read this nice topic, and this is what trigered my will to make this an analogic/discrete piece of hardware:
http://www.diyaudio.com/forums/soli...digital-sampling-audio-spectrum-analyser.html
Its a pitty that there is no info about the op-amp filters.
Gonna google a bit more.

Heathkit made one of these, just find a manual (if there is an archive site).
 

star882

Member
2007-03-19 8:41 pm
I would like to do boot ways, fft and analogic way, can anyone recommend a book about this subject, as the spectrum analysers made by radio guys are way over my head.
At audio frequency, using both analog band splitting and a microcontroller is just silly.

The traditional way to do it is with a tunable bandpass filter and a peak detector. Making an analog filter tunable over 20Hz to 20kHz is tricky, so upmix it with a high frequency (400kHz in this example) carrier in order to get a 400.02kHz-420kHz signal for which it's easy to build a tunable filter using common diodes as varactors. (RF spectrum analyzers do something similar but they usually downmix instead of upmix.