Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

FFT on Microchip Dspic and Matlab

Status
Not open for further replies.

malik_123

Member level 4
Joined
May 14, 2007
Messages
68
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,784
i designed the FFT on Dspic 33FJ128GP306 processor .

its 128 point FFT.

i generated different waves using Dspic works and plotted the resultant FFT ( after squaring real and imaginary components ) .

i used the same data in matlab to generate the FFT. and plotted the data

the results are accurate for triangle wave . i am getting the peak at that same for both i.e. the out put of both Matlab and Dspic are giving the same result.

but there is a problem in the Sin waves fft.

i performed FFT on Sin wave of frequency 80 Hz.

the resultant Matlab FFT out put was just one peak at the proper BIN.

however, in the FFT performed by the Dspic had many other peaks

though the first Peak was exactly on the same bin .

what could be the reason . ?
can some one help me ?
 

Jack// ani

Advanced Member level 3
Joined
Dec 2, 2004
Messages
759
Helped
106
Reputation
220
Reaction score
58
Trophy points
1,308
Activity points
5,006
Can you post image of FFT output in question?
 

malik_123

Member level 4
Joined
May 14, 2007
Messages
68
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,784
attach is the fft files . I write the program using CCS compiler , but simulation was done on the Mplab ide.
I used the Matlab to get the samples of sine wave. put it in the array "input". Then the fft is done.
one need to change this value

#define FFT_BLOCK_LENGTH 128
in file FFT.h accordingly for how much points of FFT he wants to do.

I used following steps to check the program

1) install CCS compiler
2) install Mplab ide.
3) Install CCS Mplan ide plugin
4) use Matlab to get the sample of any waveform
5) perform fft on the above wave form
5) use matlab to plot the absolute value of fft

6) use the sample waveform values from step 4 in the Dspic program
7) used simulation to get the result .
8) extracted the result and plot the values in Matlab .
9) compare the result.
 

Attachments

  • FFT_with different twidel.zip
    373.9 KB · Views: 40
Last edited:

petrio

Newbie level 1
Joined
Feb 1, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,287
attach is the fft files . I write the program using CCS compiler , but simulation was done on the Mplab ide.
I used the Matlab to get the samples of sine wave. put it in the array "input". Then the fft is done.
one need to change this value

#define FFT_BLOCK_LENGTH 128
in file FFT.h accordingly for how much points of FFT he wants to do.

I used following steps to check the program

1) install CCS compiler
2) install Mplab ide.
3) Install CCS Mplan ide plugin
4) use Matlab to get the sample of any waveform
5) perform fft on the above wave form
5) use matlab to plot the absolute value of fft

6) use the sample waveform values from step 4 in the Dspic program
7) used simulation to get the result .
8) extracted the result and plot the values in Matlab .
9) compare the result.

Hello. Thanks for sharing your file. I downloaded the file and tried to compile it with my CCS but it gives me "error 4" for the commands #include <twidelfactor.h> and #include "fft2.h". What do you think I soul do to solve this problem.

thanks

---------- Post added at 01:50 ---------- Previous post was at 01:48 ----------

Sorry again. I wanted to correct what I said. it gives me "error 44" for the commands #include <twidel_factor.h> and #include "fft2.h".
 

jozvil

Newbie level 1
Joined
Feb 4, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,283
could u please send the fft input and output waveforms
 

malik_123

Member level 4
Joined
May 14, 2007
Messages
68
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,784
I will try my best and let u know about the waveform.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top