%%Experiment No.2
%Aim:To study and perform various operation on signal (Folding , Shifting ,
%Time Scaling and Amplitude Scaling
%Name: Anurag R Kados
%Roll NO.: EC2162
%Batch No.: A-5
%Class: SY-A
%Subject: Signal & System
%Scaling of Signal
%Time Scaling of DT a Signal
n=[-2 -1 0 1 2 3 4 ];
x=[3 1 0 4 6 2 9];
plot(n,x);
hold on;
n2=4*n;
plot(n2,x);
n3=2*n;
stem(n3,x);
%Amplitute Scaling of a DT Signal
n=[-2 -1 0 1 2 3 4];
x=[3 1 0 4 6 2 9];
plot(n,x);
hold on;
x2=4*x;
plot(n,x);
x3=2*n;
plot(n,x);
%Folding and Shifting(Right Shift: Delayed Signal/Left Shift: Advanced
%Signal of a Signal
%Original Ramp Signal
n=0:1:10;
x=n;
subplot(2,2,1);
plot(x,n);
xlabel('t');
ylabel('r(t)');
title('Ramp');
%Folding Signal
n=0:1:10;
x=n;
subplot(2,2,2);
plot(-n,x);
xlabel('t');
ylabel('r(-t)');
title('Folded Ramp');
%Delayed Shifting
n=0:1:12;
x=n;
subplot(2,2,3);
plot(n+2,x);
xlabel('t');
ylabel('r(t)');
title('Delayed Ramp');
%Advanced Ramp
n=0:1:12;
x=n;
subplot(2,2,4);
plot(n-2,x);
xlabel('t');
ylabel('r(t)');
title('Advanced Of Ramp');