Searching \ for '[PIC]: Audio Ideas?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=audio
Search entire site for: 'Audio Ideas?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Audio Ideas?'
2000\05\26@125318 by Josh Koffman

flavicon
face
Greetings,
I had an idea, and I wonder if it would work. Basically, I want to
construct an 8 channel audio VU meter (level meter). This would be used
on a mic/line level source rather than a speaker level source. I think
there are dedicated chips for this, however I wondered if I could do it
with a pic. If I used a 16f877, i'd have 8 analogue inputs, and I could
use an 8 bit port for an 8 segment LED bar graph, and another 8 bit port
to multiplex 8 of those bar graphs. I just am not sure that feeding the
audio signal straight into the ADC would work. I know I would have to
figure out the voltage range.

Supposing this works, would it the be possible to make a small audio
spectrum analyzer? Perhaps if I put a filter on each analogue input that
only allowed one frequency, or a small frequency range through?

Anyways, I was just brainstorming. Is any of this even possible? BTW
James did I get the header right?

Thanks in advance,
Josh Koffman
spam_OUTjoshyTakeThisOuTspammb.sympatico.ca

2000\05\26@130542 by James Paul

flavicon
face
Yes, I believe all this could be accomplished.   As far as the audio
being input directly into the PIC, I would convert it to DC first
with a relatively fast filter (short time constant) to smooth the
output.  This would be better in my opinion than straight audio AC.
As fas as filters, there are many many possibilities.  But yes, this
too should work.  Unless you have some very good caps and resistors
(or inductors) though, you're not going to be very accurate.

                                        Regards,

                                          Jim




On Fri, 26 May 2000, Josh Koffman wrote:

{Quote hidden}

jimspamKILLspamjpes.com

2000\05\26@131357 by James Paul

flavicon
face
Yes, I believe all this could be accomplished.   As far as the audio
being input directly into the PIC, I would convert it to DC first
with a relatively fast filter (short time constant) to smooth the
output.  This would be better in my opinion than straight audio AC.
As fas as filters, there are many many possibilities.  But yes, this
too should work.  Unless you have some very good caps and resistors
(or inductors) though, you're not going to be very accurate.

                                        Regards,

                                          Jim




On Fri, 26 May 2000, Josh Koffman wrote:

{Quote hidden}

EraseMEjimspam_OUTspamTakeThisOuTjpes.com

2000\05\26@135955 by M. Adam Davis

flavicon
face
This is something I've been meaning to make.  But it will still be a month or
two before I get to it, so...

You have 1 analog input, and run the chip at 20MHz.  Use a fast fourier
transform to get the level in 10 different frequency bands, and drive a 10x10
matrix of LEDs.  One could do an 8x8 or 16x16 or just about any size spectrum
analyzer out of such a setup.  A 16f876 would have the right number of I/O to do
10x10 with one audio input and an extra i/o pin.  It may not be too much to ask
for to have it drive two 8x8 displays with two audio inputs.

At any rate, there have been several threads on FFT on a PIC in the past, look
at http://www.piclist.com/ for the archive and search for FFT.

You should probably start out doing a reguler VU meter first, then do a
peak-holding VU meter, then decide whether a spectrum analyzer is worth it or
feasable.  By then the 18Fxxx chips will be common with their 8x8 multiply to
speed your fft up quite a bit.

-Adam

Josh Koffman wrote:
{Quote hidden}

2000\05\26@145226 by Dan Michaels

flavicon
face
Josh Koffman wrote:
>Greetings,
>I had an idea, and I wonder if it would work. Basically, I want to
>construct an 8 channel audio VU meter (level meter). This would be used
>on a mic/line level source rather than a speaker level source. I think
>there are dedicated chips for this, however I wondered if I could do it
>with a pic. If I used a 16f877, i'd have 8 analogue inputs, and I could
>use an 8 bit port for an 8 segment LED bar graph, and another 8 bit port
>to multiplex 8 of those bar graphs. I just am not sure that feeding the
>audio signal straight into the ADC would work. I know I would have to
>figure out the voltage range.
>
>Supposing this works, would it the be possible to make a small audio
>spectrum analyzer? Perhaps if I put a filter on each analogue input that
>only allowed one frequency, or a small frequency range through?
.........

Writing this after reading some of the other responses:

- FFT on a PIC might be the worst way to go for this project.
 Digital bandpass filters might be better - much less computation
 intensive. Also, check a piclist thread a couple of months back
 called "Don't use Microchip's FFT".
- many past audio systems have used h.w. bandpass filters, and this
 would cetinaly work here too.
- if you really want VU meter functionality, you might need to consider
 a logarithmic scale - and remember the PIC only has 8-bit A/D which
 isn't gonna give you much dynamic range.

2000\05\27@012918 by Josh Koffman
flavicon
face
James Paul wrote:
>
>  Yes, I believe all this could be accomplished.   As far as the audio
>  being input directly into the PIC, I would convert it to DC first
>  with a relatively fast filter (short time constant) to smooth the
>  output.  This would be better in my opinion than straight audio AC.
>  As fas as filters, there are many many possibilities.  But yes, this
>  too should work.  Unless you have some very good caps and resistors
>  (or inductors) though, you're not going to be very accurate.
>
>                                          Regards,
>
>                                            Jim
Jim,
Thanks for your response. I am actually most interested in just the VU
meter section - the analyzer was just a "what if" question. What kind of
filter would I need? And why would this be better than just straight
audio AC.

Thanks
Josh Koffman
@spam@joshyKILLspamspammb.sympatico.ca

2000\05\27@014855 by Josh Koffman

flavicon
face
"M. Adam Davis" wrote:
>
> This is something I've been meaning to make.  But it will still be a month or
> two before I get to it, so...
>
> You have 1 analog input, and run the chip at 20MHz.  Use a fast fourier
> transform to get the level in 10 different frequency bands, and drive a 10x10
> matrix of LEDs.  One could do an 8x8 or 16x16 or just about any size spectrum
> analyzer out of such a setup.  A 16f876 would have the right number of I/O to do
> 10x10 with one audio input and an extra i/o pin.  It may not be too much to ask
> for to have it drive two 8x8 displays with two audio inputs.

Something like that (2 inputs, 8x8 display) sounds really interesting. I
imagine the coding for this would be pretty hard though. This is
probably a bit out of my league.

> At any rate, there have been several threads on FFT on a PIC in the past, look
> at http://www.piclist.com/ for the archive and search for FFT.
>
> You should probably start out doing a reguler VU meter first, then do a
> peak-holding VU meter, then decide whether a spectrum analyzer is worth it or
> feasable.  By then the 18Fxxx chips will be common with their 8x8 multiply to
> speed your fft up quite a bit.

Right now all I really want is the VU meter. Do you think it is even
feasible to do an 8 input, 8 bar graph out VU meter in a 16f877? Do you
have any pointers as to how to even begin? I checked the archive, and I
still am not sure how to process the input on adc to provide a proper
output on the display. If I can only get one output per pic, it would
probably be easier to use a dedicated linear chip. I only want to use
the pic for the coolness factor, plus a reduced parts count, and
eventually I can interface it with a computer.

Thanks,
Josh Koffman
KILLspamjoshyKILLspamspammb.sympatico.ca

2000\05\27@071653 by Bob Ammerman

picon face
This sounds like a neat project.

If you want to do the Vu meter thing, you might consider the following
design:

Take each analog input, run it thru an op-amp to buffer it (so you don't
affect the signal in its normal use).

Take the output of the op-amp and half-wave rectify it with a diode
(actually, I think you have to include the diode in the op-amp's feedback
somehow so that you don't have the diode drop affecting your output).

Run the resulting DC signal thru a resistor to a cap. This forms a simple
low-pass filter.

Connect the cap to an A/D input on the PIC.

In your PIC code, periodically reprogram the A/D input to be an output and
drive it low. This will discharge the CAP.

Then, go back to an A/D input, give the signal time to charge the cap up
(this time interval should be very consistent), then read the voltage on the
cap.

Since you want a logarithmic display, you could actually just use each bit
of the converted result to drive one of the LED's (each LED would then
represent a factor of 2 (I think that is 3 dB!).

Have fun.

Bob Ammerman
RAm Systems
(high function, high performance, low level software)

2000\05\27@074016 by Alok Dubey

flavicon
face
hi,
if u include the diode in the opamps f/b u have a log amp there itself...
might as well use an offset DC on it to make it fn as a log amp and simply
give this o/p to a A/D convertor.. and some nice math to compute the o/p in
db.
again ur diode should be a nice one.. and some temp compensation will be
reqd..
this is a std log amp ckt Vo/p =ln (Vi/p)=2.303log(Vi/p)
have fun and let me knw what u up to..

Alok


{Original Message removed}

2000\05\27@132915 by rottosen

flavicon
face
Josh Koffman wrote:
{Quote hidden}

How about a compromise on the coolness factor?

Use a PIC (or it may need the higher speed of an SX) to generate the
clocks to several switched capacitor filters.

Just a thought  :-)

-- Rich

2000\05\27@143919 by Jim P

flavicon
face
Oops! Did anyone else catch this?

"of the converted result to drive one of the LED's (each
LED would then represent a factor of 2 (I think that is 3 dB!)."

- S/B  "6" dB

(Not meaning to beat a dead horse or anything - but here's
 a quick review of the dB anyway ...)

Voltage factor of         2 = 6 dB
Voltage factor of  1.414 = 3 dB

Power ratio of 2 = 3 dB
Power ratio of 4 = 6 dB

Computing decibels:
Power ratio:    10 * log_sub_base10 (P1/P2) = dB
Voltage ratio:  20 * log_sub_base10 (P1/P2) = dB


{Original Message removed}

2000\05\27@150031 by Jim P

flavicon
face
Correction on the last formula:

Voltage ratio:  20 * log_sub_base10 (V1/V2) = dB



----- Original Message -----
From: Jim P <spamBeGonejvpollspamBeGonespamdallas.net>
To: <TakeThisOuTPICLISTEraseMEspamspam_OUTMITVMA.MIT.EDU>
Sent: Saturday, May 27, 2000 1:36 PM
Subject: Re: [PIC]: Audio Ideas?


Oops! Did anyone else catch this?

"of the converted result to drive one of the LED's (each
LED would then represent a factor of 2 (I think that is 3 dB!)."

- S/B  "6" dB

(Not meaning to beat a dead horse or anything - but here's
 a quick review of the dB anyway ...)

Voltage factor of         2 = 6 dB
Voltage factor of  1.414 = 3 dB

Power ratio of 2 = 3 dB
Power ratio of 4 = 6 dB

Computing decibels:
Power ratio:    10 * log_sub_base10 (P1/P2) = dB
Voltage ratio:  20 * log_sub_base10 (P1/P2) = dB

2000\05\27@150243 by Bob Ammerman

picon face
Right you are of course. (What can I say, I'm a programmer Jim, not an
Electrical Engineer!). I should have known better tho'.

Bob Ammerman
(high function, high performance, low level software)

{Original Message removed}

2000\05\27@150906 by Jim P

flavicon
face
... sawright ... that's what we're here for!

Jim

----- Original Message -----
From: Bob Ammerman <RemoveMERAMMERMANspamTakeThisOuTPRODIGY.NET>
To: <PICLISTEraseMEspam.....MITVMA.MIT.EDU>
Sent: Saturday, May 27, 2000 1:51 PM
Subject: Re: [PIC]: Audio Ideas?


Right you are of course. (What can I say, I'm a programmer Jim, not an
Electrical Engineer!). I should have known better tho'.

Bob Ammerman
(high function, high performance, low level software)

----- Original Message -----
From: Jim P <EraseMEjvpollspamDALLAS.NET>
To: <RemoveMEPICLISTEraseMEspamEraseMEMITVMA.MIT.EDU>
Sent: Saturday, May 27, 2000 2:36 PM
Subject: Re: [PIC]: Audio Ideas?


{Quote hidden}

the
{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...