> From: nogueira > > I'm trying to do a audio spectrum analizer using a 16C73 and the only > problem I have is how to measure the amplitude of the incoming signal. > I have to measure the amplitude at 32Hz, 64Hz, 125Hz, 250Hz, 500Hz, > 1000Hz, 2000Hz, 4000Hz, 8000Hz and 16000Hz. > I don't want to do a separate bandpass filter for each frequency, I just > want to dos this by software. > Does any one have any ideas? Ok, so you've given up on the complete FFT adventure (don't blame you). If you are interested in specific frequencies like the above, you can use the technique implemented in my DTMF decoder to measure the amplitude of single, selected, tones. However, given the wide range of frequencies involved, this may not prove feasible. May I suggest a tunable filter front-end? I have experimented with a device called the MF8 (National Semiconductor), which is a tunable band pass filter, in an application similar to the one you are describing. The beauty of this device is that both the centre frequency and Q are digitally controlled, plus you get an op-amp front end to add a little gain if required. The Q is set to one of 32 values from 0.5 to over 100 (I think) based on 5 digital inputs. The centre frequency is set by sending a clock rate of either 50 or 100 times the desired centre frequency to a digital input. Some problems with this approach: . the MF8 requires +- >=5V supplies (or >=10) so level shifting will be required for the ADC. . Sampling will be slow at the low frequencies since you will need to allow the output to settle for 4 or more cycles depending on the Q. If you sample for N cycles, the total sample time will be N/32 + N/64 + ... ~= N/16 seconds. . The required max sample rate will be 8*16KHz for sufficient accuracy (+-1.5dB). I think the PIC ADC can keep up with this, but you'd better check. If not fast enough, add an analogue peak detector to the MF8 output, and sample this at the end of 10 cycles. An extra PIC pin will need to be assigned to the duty of resetting the peak detector. . The required clock rate at 16KHz will be 50*16KHz = 800KHz so you will need to run the PIC at high speed and use the PWM module, controlling the frequency with the period register, and maintaining as close as possible to 50% duty cycle. Regards, SJH Canberra, Australia