Signal Operations-Continuous Time: For If
Signal Operations-Continuous Time: For If
clear all;
t=-10:0.01:10;
n=1;
subplot(2,1,1);
for u=-10:0.01:10
if (u>=-2 & u<=1)
x(n)=u;
n=n+1;
elseif ((u>1)&(u<=3))
x(n)=1;
n=n+1;
else
x(n)=0;
n=n+1;
end;
end;
plot(t,x,'linewidth',2.2);
title('ORIGINAL SIGNAL');
xlabel('t')
ylabel('x(t)');
axis([-4 4 -3 3]);
grid on;
subplot(2,1,2);
a=input('enter the shift value');
b=input('enter the scaling factor');
plot(t/b-a/b,x,'linewidth',2.2);
grid on;
axis([-4 4 -3 3]);
xlabel('t');
ylabel('x(t)');
-3
-2
-1
x(t-1)
2
0
-2
-4
-3
-2
-1
x(t+1)
2
0
-2
-4
-3
-2
-1
2
0
-2
-4
-3
-2
-1
x(t)
2
0
-2
-4
x(-t)
ORIGINAL SIGNAL
1
t
SIGNAL DELAY
1
t
SIGNAL ADVANCE
1
t
SIGNAL FOLDING
x(t/3)
2
0
-2
x(-t+1)
x(-t-1)
2
0
-2
x(3t)
SIGNAL EXPANSION
2
0
-2
2
0
-2
-6
-4
-2
2
4
t
SIGNAL COMPRESSION
-6
-4
-2
-6
-4
-2
-6
-4
-2
x(t)
x(-2t)
x(-t/2)
x(-2t-3)
x(t)
x(-2t+3)
x(-t/3-2)
x(-t/3+2)
2
0
-2
-6
-5
-4
-3
-2
-1
t
-6
-5
-4
-3
-2
-1
t
-6
-5
-4
-3
-2
-1
t
-6
-5
-4
-3
-2
-1
t
2
0
-2
2
0
-2
2
0
-2
2
0
-2
-15
-10
-5
2
0
-2
-15
-10
-5
2
0
-2
-15
-10
-5
2
0
-2
-15
-10
-5
10
10
10
10