chipKIT® Development Platform

Inspired by Arduino™

FFT LED Spectrum analyzer

Created Fri, 16 Dec 2011 18:52:54 +0000 by stefan646


stefan646

Fri, 16 Dec 2011 18:52:54 +0000

Hello! My name is Steven and i am from Romania (so excuze my english). I am beginner on programing microcontrolelr but i want that this project to be my initiation on PIC programing.

I want to build a spectrum analyzer with 26x46 led matrix, controlled by an chipkit. So my question are:

  1. how many FFT have to make the chipKIT to give me 46 bandpass? I read on diffrent places that have to be:" bandpass x 2 FFT " to have a good sample....so 46 or 92 FFT? 2)i alsow read on diffrent places that some tipes of chips can't make FFT on a frequency highter that 10khz...i want to build a 20hz to 20khz frequency range, is that posible? 3)is a chipKIT fast enought to make this many FFT and witch is the maximum frequency that it can make FFT to have a good reflesh rate on the leds?
  2. wich kit i should buy? chipKIT Uno32 or chipKIT max32? I think that the extra ports are not considerably due to the fact that i can use multiplexing to control my leds, but my question is if the extra RAM 128k vs 16k will help the chip calculate the FFT more faster (that the human eye cand observe on the led matrix)? 5)can someone write down for me the pseudocode to make this spectrum analyzer, so i can understand the working principe of this, and hopefully that will help me to write my own code.

Thank you very much!!


Jacob Christ

Sat, 17 Dec 2011 06:10:19 +0000

Hi Steven,

I'm Jacob and I live in California near Los Angeles. I've never dug deep into the math of an FFT, so I may not be able to answer all your questions. I have implemented DFT's on Motorola 8-bit and DSP's in the past.

  1. how many FFT have to make the chipKIT to give me 46 bandpass? I read on diffrent places that have to be:" bandpass x 2 FFT " to have a good sample....so 46 or 92 FFT?

I completely don't understand this question. In terms of a DFT you would just need process your incoming signal against 46 known frequencies.

2)i alsow read on diffrent places that some tipes of chips can't make FFT on a frequency highter that 10khz...i want to build a 20hz to 20khz frequency range, is that posible?

Your frequency that you can analyze is based on your sample rate. I've gotten near 100kHz sample rate on 8-bit pics running at 48MHz, so I think the PIC32 can do at least as good. With that said, I think there are some limitations to the chipKIT ADC library that cause the sample rate to be much slower. I'm not sure if this has been fixed yet nor do I know the speed limit. If it has not been fixed, you may need to fix it to get to the speed you need.

3)is a chipKIT fast enought to make this many FFT and witch is the maximum frequency that it can make FFT to have a good reflesh rate on the leds?

My guess is yes based on other projects that some others have done around here.

http://www.youtube.com/watch?v=yoquqEL8OCc&context=C3153f84ADOEgsToPDskIpIJX1LJ-b-jiwF8wxHz0V

  1. wich kit i should buy? chipKIT Uno32 or chipKIT max32? I think that the extra ports are not considerably due to the fact that i can use multiplexing to control my leds, but my question is if the extra RAM 128k vs 16k will help the chip calculate the FFT more faster (that the human eye cand observe on the led matrix)?

Buy one of each and the network shield for the Max32... The Max32 is fun when you plug in an Ethernet cable.

Also the Max32 has built in USB port that could be used to capture audio from a USB microphone to feed into you spectrum analyzer. (some coding may be required).

5)can someone write down for me the pseudocode to make this spectrum analyzer, so i can understand the working principe of this, and hopefully that will help me to write my own code.

// This is really pseudo
// don't actually use floats, fixed point will be faster, this is just pseudo
float sample;
float spectrum_re[46];
float spectrum_im[46];
float spectrum_amp[46];

while(1)
{
     sample = read_adc();
     fft(spectrum_re,spectrum_im,spectrum_amp);
     display(spectrum_amp);
     wait_unitl_time_to_sample_again();
}

Thank you very much!!

I do what I can.

Jacob


stefan646

Sat, 17 Dec 2011 11:20:33 +0000

Thank you Jacob! I will update this topic as i found more answers :D


stefan646

Thu, 22 Dec 2011 14:05:58 +0000

My final matrix will be 26X64 LEDs. chiKIT Max32 has 83 I/O ports. 1 port i will use for the analog to digital input, 1-3 for the push-button, 2 ports for an eventualy TV Out(i see that Arduino has a library of that), so i will remain only with aprox. 75 I/O ports for controlling the matrix. So my question is: what tip of IC i should use for expanding (and how many) : multiplexing, shift register , etc. The best chose will be the one with the simplest code to implement no the one with the most simplicity to build or the cheapest.


Felipe Stalvey

Fri, 06 Apr 2012 02:56:33 +0000

I think there's a guy on Pirate that is having his buddy overseas ship them to him, so he can sell them. I don't think he's marking them up since he's not pimping a yellow star.