Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- SS_lab_06
- Rahat Sir
- Date: 23-10-2019
- %}
- % Convolution_4
- % x(t) = (t-1) (u(t-1)-u(t-3)
- tx = 1:.01:3;
- x = tx - 1;
- % h(t) = u(t+1) - 2u(t-2)
- th1 = -1:.01:2;
- th2 = 2:.01:10;
- th = [th1 th2];
- h = [ones(size(th1)) -1.*ones(size(th2))];
- % convolution integral
- y = conv(x,h);
- %% Convolution_5
- % interconnection of system
- % Cascade system
- %first System
- th1 = 0:.01:3;
- th2 = 0:.01:3;
- th22 = 3:.01:6;
- h1 = th1 .* exp(-3*th1);
- tx = 0:.01:3;
- x = ones(size(tx));
- w = conv(x,h1).* .01; % 0 to 6
- tw = linspace(min(tx)+min(th1),max(tx)+max(th1), length(w));
- h2 =[th2.*cos(pi * th2) zeros(size(th22))];
- y = conv(w,h2).*.01;
- ty = linspace(min(th2)+min(tw),max(th2)+max(tw), length(y));
- figure
- plot(ty,y);
- % Second System
- h2 = th2.* cos(pi * th2);
- w2 = conv(h1,h2).* .01;
- tw = linspace(min(th2)+min(th1),max(th2)+max(th1), length(w2));
- x2 = [x zeros(size(th22))];
- tx2 = [tx th22];
- y2 = conv(x2,w2).*.01;
- ty2 = linspace(min(tx2)+min(tw),max(tx2)+max(tw),length(y2));
- figure
- plot(ty2,y2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement