[sdiy] newbie question Can a simple PIC16F628A be used asan audio filter trigger like a light organ

Richie Burnett rburnett at richieburnett.co.uk
Wed Feb 24 18:03:04 CET 2016


That chip is neat!  It's a shame that the datasheet title incorrectly says 
it is a "Seven Band Graphic Equalizer" when in truth it's a Seven Band 
Spectrum Analyser though.  A bit misleading.

-Richie,



-----Original Message----- 
From: Jay Schwichtenberg
Sent: Wednesday, February 24, 2016 4:42 PM
To: synth-diy at dropmix.xs4all.nl
Subject: Re: [sdiy] newbie question Can a simple PIC16F628A be used asan 
audio filter trigger like a light organ

This chip might be useful for this type of application depending on the
frequency bands you want. It basically samples the frequency bands and you
clock out voltages for each bands amplitude measuring the voltage with a
ADC. So the mcu needs at least one digital pin and a ADC.

https://www.sparkfun.com/products/10468

Jay S.

-----Original Message-----
From: Synth-diy [mailto:synth-diy-bounces at dropmix.xs4all.nl] On Behalf Of
Tom Wiltshire
Sent: Wednesday, February 24, 2016 1:24 AM
To: Rob
Cc: synth-diy at dropmix.xs4all.nl
Subject: Re: [sdiy] newbie question Can a simple PIC16F628A be used as an
audio filter trigger like a light organ

I reckon it's possible. It's not at all easy, but it's possible. To get such
a thing into a simple chip like that is going to need seriously tweaked
code, or (equivalently) a seriously tweaked programmer. I'd seriously doubt
it can be done in PICBasic. I'm impressed if you can pull that off.

You'd have to sample the audio with the on-board ADC, say 20-25KHz, 8-bit.
Then you need some broad-brush frequency detection. We're not looking for
amplitude envelope information, merely presence/absence of signals within a
band, so that simplifies things a bit. This is a light organ, not a spectrum
analyser.

I'd be looking at IIR filter algorithms based on bit shifts, since we've got
no multiply. A LP/HP pair of filters would give you your band detection.
Since you can do a HP as 1-LP, you could use the lower filter for the next
band up as the upper filter for the band below and save yourself some more
calculation. That reduces a 4-band detector to only four filters to work
out.

Once you've got signals in the various bands, I'd rectify the signal and do
some simple threshold detection to trigger the outputs. Something like "If
the highest bit of the byte is set, trigger the output". Furthermore, to
stop the outputs oscillating at the audio rate, you'd need to trigger an
output for a few milliseconds minimum time - use a monostable for the
output, effectively.

HTH,
Tom


On 24 Feb 2016, at 05:33, Rob <roomberg at ptd.net> wrote:

> I'm an electronic hobbyist. Nothing professional.... just playing here.
> The goal is to feed MP3 music to a light trigger circuit.
> Something like a light organ.
> But have a much finer granularity than a light organ that has low, mid and
highs separation.
> I have PIC16F628A chips and PicBasicPro so I was thinking of using PULSIN
to look for audio tones... real high stuff... around 6kHz ,7kHz and 8kHz.
>
> I had been building audio band bass filters with op-amps when it occurred
to me that PicBasic WILL listen for tones and assign a value to a variable.
But I had not seen anything that resembled this circuit before.
>
>
>
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy

_______________________________________________
Synth-diy mailing list
Synth-diy at dropmix.xs4all.nl
http://dropmix.xs4all.nl/mailman/listinfo/synth-diy

_______________________________________________
Synth-diy mailing list
Synth-diy at dropmix.xs4all.nl
http://dropmix.xs4all.nl/mailman/listinfo/synth-diy


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7442 / Virus Database: 4537/11689 - Release Date: 02/24/16 




More information about the Synth-diy mailing list