|
Part 2: The Rest of the Story
by Dan Cross-Cole
Start ý All
the Pieces ý Using the DSP/FFT System
ý Sources and PDF
In Part 1, which is in this monthýs print
magazine (Circuit Cellar 122), I consider a Digital Signal
Processing (DSP) board for implementing audio band-pass filters. In
Part 2, youýll learn how to use a QuickBASIC program to provide a
graphical display of the audio filter output. Youýll see how the filter
affects the output of your favorite audio device.
For example, the combined system of digital
filters and Fast Fourier Transform (FFT) can be used to isolate the
bass, midrange, and treble responses of a speaker or audio system.
As a ham radio enthusiast, I use the system to isolate Morse code
signals to a narrow audio range. I can also use it to display several
signals simultaneously and evaluate the audio output from my home-brewed
shortwave receivers. I have even used it to compare acoustic guitars
by their resonant characteristics.
In Mathematical Methods for Physicists
by George Arfken [1], a Fourier series is defined as a representation
of a function in a series of sines and cosines such as:

For an ideal representation, m should
be without limit. The sines and cosines represent the frequency components
of the signal, as well as their relative phases. A limitless m
implies high frequencies. For practical calculations, limit m
to a reasonable number based on the highest frequency to be measured.
Typically, the system will take data at a frequency that is twice
the highest frequency of the system. The value of m would then
correspond to the highest frequency being measured. (In fact, m =
2pf,
in which f equals frequency.)
The QuickBASIC program calculates the
constants an and bn using various shortcuts
and displays the data on the laptop screen. The FFT routine in the
program is taken from Hal Chamberlinýs book, Musical Applications
of Microprocessors. [2] If you want to know more, check out this
book, it provides detailed explanations. It also has a good coverage
of computers and music applications.
To be able to display data in near real
time, you must take some samples, perform the calculations, display
the results, and then take more samples, repeating the cycle. The
key phrase here is "take more samples."
The program takes about 8000 samples
per second on a laptop that operates at 40 MHz. The sampling circuit
is controlled through a board that plugs into the ISA bus of the laptop
docking station. The input to the sampling circuit comes from the
output of the DSP board (see Part 1).
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ýCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |