Spectrum Analyser (Poor Man's)

Dippy

Moderator
A recent thread showed a low res Spectrum Analyser.

I have just done a bit of twiddling and found that you can make a 'rough' Spectrum Analyser using the Nat Semi LMF100:-
http://uk.farnell.com/9487735/semiconductors-integrated-circuits/product.us0?sku=national-semiconductor-lmf100ccn

Unfortunately I did it using a PIC, so I cannot post any PICAXE code.
Suffice it to say all you do is use PWM to control the LMF100 switching speed.
The chip provides control of bandwidth and has a Bandpass output which you can rectify and read using ADC.
No, its not as good as FFT by a long way, but you can't FFT on a PICAXE. Well maybe you could but the calcs would take all day.
By setting PWM then READAdc in steps you can get numbers showing the amplitude in that F-band (not forgetting bandwidth), so it's a bit rough but gives reasonable results as long as you don't expect high resolution.
You may need an aliasing filter depending on your source - all in the Data Sheet if you can be bothered to read it :)

The same chip can also allow you to make a PICAXE controlled low-pass and band-pass filter which may be of interest to users of mushy radio reception.
 

womai

Senior Member
Interesting chip; combined with the analog frontend (amplifier/attenuator section) of my Picaxe scope this could give a quite versatile spectrum analyzer, Although I will it could go up to frequencies higher than 100 kHz.

You could also use a second such chip, set it up as a low-pass filter, feed it with a PWM signal from the Picaxe, and set the filter's cutoff at around 1.5 times the PWM frequency. The output is then close to a sine wave (the PWM square wave only has odd harmonics, and the filter will remove them). Combined with the spectrum analyzer circuit - tuned to the same frequency - you have a full-blown scalar network analyzer (Bode plotter) for analysis of filters etc.

I should mention that my Picaxe scope design (http://www.pdamusician.com/lcscope/) also has a spectrum analyzer mode. This one does use FFT (running on the PC, not inside the Picaxe), and it goes up to 500 kHz max. (based on the 1 MSample max. sampling rate); analog bandwidth is around 400 kHz so it is a bit more capable than the LMF100 chip solution, and it already has and amplifier/attenuator.

Wolfgang
 

Dippy

Moderator
I wasn't trying to 'out-do' your project Wolfgang. Don't panic. It could never reach those frequencies.

It would just make a simple 3 ic device (PICAXE/Op-Amp/LMF100) for rough audio analysis. A bit like the display on some Graphic Equalisers. As I said initially; it is not a patch on FFT which has (depending on your sample size) much higher resolution. I've done FFT on PICs and dsPICs so I am familiar with the methods. It is complex (a pun to anyone who understands FFT) and far too maths-intensive for a PICAXE project.

In conjunction with LED bar-graphs or GLCD you could make a simple portable device. And/or a programmable audio filter, but not Hi-Fi.

As it is a switched capcitor design you may need aliasing filters, as you would also on your sampling FFT design.

FYI I'm doing a dsPIC version right now and am getting impressive results with a 30F6014A.
Part of my Doppler Radar speed detector Mk2.

Anyway, it was just a suggestion for anyone who likes dabbling and I'm sure it won't affect your sales :)
 

womai

Senior Member
Hi Dippy,

no need to worry, I'm far from panic :) Actually I love trying out new types of chips, so if I find a little time I may get myself a couple of those filter chips. BTW, for an audio analyzer the common approach is to display the power per octave (or half-ocatve, or quarter-octave) rather than the power per Hz, i.e. a logarithmic scaling rather than a linear scaling in the frequency direction, since that is closer to how the human ear perceives loudness.

Wolfgang
 
Top