[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

07/23/2009 at 02:44PM PDT, ID: 24596247 | Points: 125
[x]
Attachment Details

Matlab FFFT Output Data

Asked by okd in MatLab Programming Language

I have the following final code. I have 12 data sets. Hower FFT is performed for 14 data sets. I printed the FFT output data. Why the two data sets have no imaginary values? Are these zero values? It looks to be something like FFT is performed on some regular number of data sets. Also I was wondering how to draw an average curve line (by curve fitting ) on the fourier spectrum plot.

Thanks, - okd

The Following is the Final MATLAB Codes.

Reading File
---------------
» data1=dlmread('C:\Documents and Settings\DDR\My Documents\Ltest.txt','\t');

Incrementing by 0.02 to generate time data
---------------------------------------------------

» dstart = 0.02;
» dstep = 0.02;
» n = length(data1);
» dend = dstart+dstep*(n-1);
» data2 = (dstart:dstep:dend)';   % ' is for transpose
» data = [data1 data2]; % add data2 as a second column to data1

Integration
-------------

» intvalue=cumtrapz(data2, data1);
» plot(data2, intvalue);

Fourier Transform
----------------------

» NFFT=2^nextpow2(n);
» Y=fft(data1,NFFT)/n

Y =

   1.3545          
  -2.0474 + 0.7045i
   1.2596 + 0.1405i
  -0.1336 - 1.0734i
  -1.5277 + 0.8807i
   0.9026 + 0.0748i
  -0.3674 - 0.3528i
  -0.5716 + 0.4137i
   0.6073          
  -0.5716 - 0.4137i
  -0.3674 + 0.3528i
   0.9026 - 0.0748i
  -1.5277 - 0.8807i
  -0.1336 + 1.0734i
   1.2596 - 0.1405i
  -2.0474 - 0.7045i

»  f=(50/2*linspace(0,1,NFFT/2+1))';
» plot(f,2*abs(Y(1:NFFT/2+1)));
»
[+][-]07/23/09 06:52 PM, ID: 24931821

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/25/09 04:27 AM, ID: 24941308

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/25/09 04:49 AM, ID: 24941361

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/27/09 10:51 AM, ID: 24954045

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/27/09 12:03 PM, ID: 24954795

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/27/09 12:40 PM, ID: 24955142

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/27/09 01:15 PM, ID: 24955520

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/06/09 09:48 PM, ID: 25272741

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20090701_SELECT_ZONES