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.

[SOLVED] FFT of given signal in matlab

Status
Not open for further replies.

pravinkadam2

Newbie level 2
Joined
Aug 18, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Activity points
1,297
I am trying to replot FFT of following signal in MATLAB
But i am not getting exact result
Signal having sampling frequency is 1024 Hz and the sampling time is 1s
and for more description please find attached file
Its very urgent PLEASE help me
thank u in advance
 

Attachments

  • my paint.bmp
    1.2 MB · Views: 92

Try,
t=0:Ts:10;
y=x1+x2+x3;
plot(t,abs(fft(y)));
 

That i also know ,But i am not getting how to plot second fuction ie x2(t) .They are telling exponentially decaying fuction.
Otherwise i am attaching my matlab file just find out what mistake i am doing.
clear all
close all
clc
t=linspace(0,1,1024);
y1 = sin(2*pi*30*t)+cos(2*pi*50*t) ;
for i=1:1024
ii=mod(i,50);
if ii==0
y(i)=0;
else
y(i)=exp(-20*t(ii)).*sin(20*pi*t(ii)) ;
end
end
Fs = 1024; % Sampling frequency
L = 1024;
%y3 = wgn(1,1024,0);
%y3=randn(1,length(t));


y3=wgn(1, 1024,5,20, 'dBm', 'real');
ytot=2*y1+9*y+y3;

Y=ytot;
figure(1)
plot(t,Y);
axis([0 1 -6 8])

freq = 0:1:Fs/2 ;
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y1 = fft(Y,NFFT)/L;
xf = fft(Y)/length(Y) ; % signal
xfr = xf ; % copy
xf2 = abs(Y1) ;
xf3 = xf2(1:513) ;

figure(2)
plot(freq, xf3*1024) ;
%axis([0 250 0 1.2])
xlabel('frequency in(Hz)')
ylabel('amplitude')
 

Attachments

  • my paint.bmp
    1.2 MB · Views: 117

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top