Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- SS Lab Class no 09
- Date: 20.11.2019
- Place: CL3
- Time: 10.30 AM -12.30 AM
- Minhaj Rahat Sir
- %}
- clc;
- clear all;
- close all;
- syms t;
- x = heaviside(t+6)-heaviside(t-6);
- T =12;
- w = 2*pi/T;
- k = -100:100;
- an =(1/T)*int(x*exp(-j*k*w*t),t,-6,6);
- xn = sum(an.*exp(j*k*w*t));
- figure
- ezplot(xn,[0,10]);
- %% Experiment 02
- clc;
- clear all;
- close all;
- syms t w
- a = 0.5;
- f = exp(-a*t) * heaviside(t);
- an = fourier(f,w);
- ww = -2*a:.1:2*a;
- a = subs(an,w,ww);
- subplot(2,1,1)
- plot(ww,abs(a))
- xlabel('Frequency');
- ylabel('Amplitude');
- subplot(2,1,2)
- plot(ww,angle(a))
- xlabel('Frequency');
- ylabel('phase(radian)');
- %% Fourier Representaion of Square Wave
- syms t w
- f = heaviside(t+6)-heaviside(t-6);
- To = 6;
- an = fourier(f,w);
- ww = -3*pi/To:.001:3*pi/To;
- a = subs(an,w,ww);
- subplot(2,1,1)
- plot(ww,abs(a))
- xlabel('Frequency');
- ylabel('Amplitude');
- subplot(2,1,2)
- plot(ww,angle(a))
- xlabel('Frequency');
- ylabel('phase(radian)');
- %% Linearity of Fourier Transform
- syms t
- a1 =3; a2 =2; x1 = exp(-3*t); x2 = exp(-t);
- x = a1*x1 +a2*x2;
- left = fourier(x,w);
- right = fourier(a1*x1,w) + fourier(a2*x2,w);
- ww = -10:.01:10;
- left = subs(left,w,ww);
- right = subs(right,w,ww);
- plot(ww,abs(left),'r',ww,abs(right),'*')
Add Comment
Please, Sign In to add comment