Searching \ for 'Simple FFT for audio analisis' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: piclist.com/techref/io/audio.htm?key=audio
Search entire site for: 'Simple FFT for audio analisis'.

Truncated match.
PICList Thread
'Simple FFT for audio analisis'
1999\09\18@144530 by T_BoNe

flavicon
face
Hi!

I'm looking for a simple FFT routine for audio analisis (spectrum) that
runs on
low end PICs like the 16x84.
The device have an ADC, and I need to separate the audio in 10, 7 or
even 5 bands,
to display it on a LCD screen or fluorescent tube, along with the signal
intensity.
I've seen a program that do 128 bands, and generates video, but it's too
much for me...
My application doesn't need to be very accurate, so any simple approach
would work.

thanks

Silvio Borges
spam_OUTssjTakeThisOuTspamunorpnet.com.br

1999\09\18@145826 by Sean H. Breheny

face picon face
Hi,

I don't have a routine,but someone recently posted this link to the list:

http://www.netlib.org/

It is a collection of mathematical routines,including some FFT stuff.

Sean

At 03:43 PM 9/18/99 -0300, you wrote:
{Quote hidden}

| Sean Breheny
| Amateur Radio Callsign: KA3YXM
| Electrical Engineering Student
\--------------=----------------
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
shb7spamKILLspamcornell.edu ICQ #: 3329174

1999\09\19@022030 by Robert A. LaBudde

flavicon
face
At 03:43 PM 9/18/99 -0300, you wrote:
>I'm looking for a simple FFT routine for audio analisis (spectrum) that
>runs on
>low end PICs like the 16x84.
>The device have an ADC, and I need to separate the audio in 10, 7 or
>even 5 bands,
>to display it on a LCD screen or fluorescent tube, along with the signal
>intensity.
>I've seen a program that do 128 bands, and generates video, but it's too
>much for me...
>My application doesn't need to be very accurate, so any simple approach
>would work.

If you only need a feed points in the spectrum (< 10), you can get by with
a direct DFT without the fancy FFT logic.

You will need:

1. Table of 8-bit sines and cosines incremental frequencies (can store in
EEROM).
2. 8 x 8 multiply routine (available from MicroChip app note).
3. A 16-bit add routine (ditto).
4. Directly compute the coefficients via

       a(k) = sum(0,n-1) {x(k) * sin(2 pi k/n) }
       b(k) = sum(0,n-1) {x(k) * cos(2 pi k/n) }

5. You compute the power at each frequency by

       p(k) = a(k)*a(k) + b(k)*b(k)

6. If you want the rms power, you'll also need a sqrt routine. The simplest
method (albeit a slow one) is the Newton method

       s(i+1;k) = { s(i;k)*s(i;k) + p(k) }/{ 2*s(i;k) }

Note that this also requires a 8-bit into 16-bit division algorithm.

This is an interesting little problem that keeps coming up in
microprocessor applications. Perhaps the low accuracy and reliance on a
arithmetic library explains why such a routine is not commonly available.

Another approach would be to switch a more microprocessor friendly
analysis, such as use of z-transforms instead of Fourier transforms.

PS. I'm writing the above from memory, so that might be a couple of details
in error. Also, I haven't worried about scaling, since I assume this is
unimportant in the application.

================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: .....ralKILLspamspam.....lcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

1999\09\20@033720 by Robert A. LaBudde

flavicon
face
At 03:43 PM 9/18/99 -0300, Silvio wrote:
>I'm looking for a simple FFT routine for audio analisis (spectrum) that
>runs on
>low end PICs like the 16x84.
>The device have an ADC, and I need to separate the audio in 10, 7 or
>even 5 bands,
>to display it on a LCD screen or fluorescent tube, along with the signal
>intensity.
>I've seen a program that do 128 bands, and generates video, but it's too
>much for me...
>My application doesn't need to be very accurate, so any simple approach
>would work.

Another thought:

A simple approach to this limited problem is to use the same method used in
cheap spectrophotometers.

You set a collection 2-nd order notch filters for each of the bands required.

If the notch filters are implemented by infinite impulse response digital
filters, then only addition and multiplication are required. I would
recommend 16-bit addition to maintain accuracy and stability. Truncate to
8-bits at the end of the calculations.

Hopefully the frequencies of interest are low enough that these
calculations can be performed real-time!  My guess is that you'd need
hardware multiplies to keep up with even modest (1 kHz) audio.

================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: EraseMEralspam_OUTspamTakeThisOuTlcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

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