PIC32MX: FFT of Analog Input

From Mech
Revision as of 19:35, 27 January 2010 by Lynch (talk | contribs)
Jump to navigationJump to search

Original Assignment

Do not erase this section!

Your assignment is to read in several cycles of a periodic signal from a function generator (e.g., a sine wave or a square wave), perform an FFT on your samples using your PIC32, and send back the results to a PC to display. Try this for 256 samples and 1024 samples, and determine how long it takes to compute the FFT for each, once you have collected the data. Verify that the results make sense according to the input signals you've used; for example, a sine wave should have all power at the chosen frequency, while a square wave will have much of the power at the frequency of the wave, but power at other frequencies, too.) Check out the MPLAB C32 Libraries manual to learn more about the dsplib_dsp.h, which you must include. Try both mips_fft16 and mips_fft32.

Overview

Summarize briefly what the page is about.

Circuit

Include a schematic and give any part numbers. A photo of your circuit is OK, but not as a replacement for a schematic.

Code

Where possible, make it a single piece of well-commented cut-and-pastable code, or at least make each function that way, so others can easily copy it. Most comments should be in the code itself; outside the code (on the wiki) should only be explanatory comments that are too cumbersome to include in the code.