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.

what is wrong with this matlab code?

Status
Not open for further replies.

eejli

Advanced Member level 4
Joined
Mar 24, 2004
Messages
115
Helped
1
Reputation
2
Reaction score
2
Trophy points
1,298
Activity points
1,032
Hi Guys,

I suppose to see more spectrum rather than 0 in the spectrum.

Could you take a look on this code? I have a data file attached also.

Thanks!

----------
close all
clear all
fs=5e6;
npt=1024*4;

double temp;
double out;
temp1=csvread('11cp001_ssc_PROFILE1_Math2.csv');
leng=length(temp1);
out=csvread('11cp001_ssc_PROFILE1_Math2.csv',0,0,[0,0,0,npt-1]);
outfft=2*abs(fft(out))/npt;
outfft=outfft(1:npt/2);

df=fs/npt;
f=(0:npt/2-1)*df;
plot(f,outfft,'-x');

-------------------------
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top