Академический Документы
Профессиональный Документы
Культура Документы
Task Outline: 1. To form a sinusoidal signal with specified amplitude, frequency and for specific cycles. 2. To form a rectangular signal with specified amplitude, frequency and for specific cycles. 3. To form a triangular signal with specified amplitude, frequency and for specific cycles. 4. To form gates of sinusoidal, rectangular and triangular look. 5. To solve differential equation. 6. To find the Fourier Transform of functions such as: a. One sided exponential b. Double sided exponential c. Gate d. Sinc function
7. To find the Fourier Transform of functions such as: a. One sided exponential b. Double sided exponential c. Gate d. Sinc function
10 8 6 4 2
Sinusoidal Signals:
%Sinusoidal Signal with amplitude 10, frequency 50hz and for 2 -2 cycles clear all clc
-4 -6 -8 -1 0 0
0 .0 2
0 .0 4
0.06
0 .0 8
0 .1
0.12
0.14
Rectangular Signal Rectangular Signal with amplitude 10&15 frequency 50Hz, duty cycle 60% and 40% and for 2 0 2 cycles clear all clc t=0:.0001:2*pi/50; y1=10*square(2*50*t,60); y2=15*square(2*50*t,40); plot(t,y1,t,y2)
1 5 1 0 5 0 5 -0 1 -5 1 -0 2
02 .0
04 .0
06 .0
08 .0
0 .1
02 .1
04 .1
Triangular Signal
1 0
-0 1
02 . 0
04 . 0
06 . 0
08 . 0
0 . 1
02 . 1
04 . 1
Gate Signal: % To form gates clear all clc syms t rg=(heaviside(t+5)-heaviside(t-5)); sg=sin(t)*(heaviside(t)-heaviside(t-pi)); subplot(2,1,1) ezplot(sg,[-2*pi,2*pi]) subplot(2,1,2) ezplot(rg,[-2*pi,2*pi])
sin(t) (heaviside(t)-heaviside(t-)) 1
0.5
0 -6 -4 0 2 t heaviside(t+5)-heaviside(t-5) -2 4 6
0.5
0 -6 -4 -2 0 t 2 4 6
1 0.5 0 -0.5 -1 -6 -4 -2 0 w 2 4 6
FW=sqrt(a^2+b^2); theta=atan(b/a);
subplot(2,2,[3,4]) ezplot(theta)
-6
-4
-2
0 w
FW=sqrt(a^2+b^2); theta=atan(b/a);
subplot(2,2,1) ezplot(y) %input Signal subplot(2,2,2) ezplot(FW) %fourier transform (magnitude) subplot(2,2,[3,4]) ezplot(theta) %fourier transform (phase)
heaviside(t+5)-heaviside(t-5) sin(5 w)+conj(1/w sin(5 w)))2-(2/w sin(5 w)-2 conj(1/w sin(5 w)))2)1/2 1/2 (4 (1/w 1 10
0.5
0 0 0 5 10 -5 0 5 t w -i atanh(1/2 (2/w sin(5 w)-2 conj(1/w sin(5 w)))/(1/w sin(5 w)+conj(1/w sin(5 w)))) 1 -10 -5 0.5 0 -0.5 -1
-6
-4
-2
0 w
1/2 (4 (-1/2 heaviside(w-)+1/2 heaviside(w+ )+1/2 conj(-heaviside(w-)+heaviside(w+ )))2-(-heaviside(w-)+heaviside(w+ )-conj(-heav sin( t)/ /t a=real(Y); %Taking the real part2 1
%magnitude %phase
0.5 subplot(2,2,1) ezplot(y) %input Signal -0.5 0 subplot(2,2,2) -5 0 5 -5 0 5 ezplot(FW) %fourier transform (magnitude) t w subplot(2,2,[3,4]) eaviside(w-)+heaviside(w+ )-conj(-heaviside(w-)+heaviside(w+ )))/(-1/2 heaviside(w-)+1/2 heaviside(w+ )+1/2 conj(-heaviside(w-)+heavis ezplot(theta) %fourier transform (phase) 1 0.5 0 -0.5 -1
-6
-4
-2
0 w
NB: Same codes will be applicable to have Laplace transform except the function laplace instead of Fourier.