Continue to Site

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.

Matlab (time domain to frequency)

Status
Not open for further replies.

rayindasky

Newbie level 1
Newbie level 1
Joined
Nov 30, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,288
I have data in excel file and want to convert that to frequency domain. I wrote the following code but its giving me the wrong results.

If my data is 2,2,2,5,5,6
Shouldn't

Amplitude =2 and frequency =3
Amplitude =5 and frequency =2
Amplitude =6 and frequency =1




%Read in the data
data = xlsread('time.xls');

%Analyze the frequency components.
y=2*abs(fft(data))/length(data);
%Plot frequency versus frequency componant magnitude, circle f_max
figure
plot(x,y)
xlabel('Frequency (Hz)')
ylabel('Amplitude ')
title('Frequency Domain ')
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top