Exp No 4
Exp No 4
PART A
Experiment No.04
A.1 Aim: To Apply operations (Time shift, Reversal and Scaling) in discrete and continuous
time signals.
A.3 Prerequisite:
1. Concepts behind different operation which are applied on independent parameter of the
signal.
A.3 Outcome:
After successful completion of this experiment students will be able to
1. Apply different operation (Time shift, Reversal and Scaling) on discrete and
continuous time signals.
2. Plot the signal after applying each operation.
A.4 Theory:
Time shift:
Time shifting of signals is probably the most important one, and most widely used amongst
all basic signal operations. Its generally used to fast-forward or delay a signal, as is necessary
in most practical circumstances. Time shifting is mathematically expressed as, Y(t) = X(t -
t0). Where, X(t ) is the original signal, and t0 represents the shift in time. For a signal X(t) if
the position shift t0> 0. Then the signal is said to be right shifted or delayed. In the same
manner, if t0< 0, implies the signal is left shifted or delayed. This has been explained
diagrammatically in the figure below. Where the original signal fig(a) is right shifted and also
left shifted in figure (b) and (c) respectively.
Reversal:
Reflection of signal is a very interesting operation applicable on both continuous and discrete
signals. Here in this case the vertical axis acts as the mirror, and the transformed image
obtained is exactly the mirror image of the parent signal. It can be defined as Y(t) = X( - t)
Where, X(t) is the original signal. But if the reflected signal X( - t) = X(t); then its called an
even signal. Where as when X( - t) = − X(t); then its known as an odd signal.
Scaling:
Time scaling of signals of signals involves the modification of a periodicity of the signal,
keeping its amplitude constant. Its mathematically expressed as, Y(t) = βX(t) Where, X(t) is
the original signal, and β is the scaling factor. If β > 1 implies, the signal is compressed. And
β < 1 implies, the signal is expanded. This is illustrated diagrammatically for better
understanding.
A.5 Procedure/Algorithm:
1. Start MATLAB.
2. Clear the screen.
1. Define the unit impulse signal and plot the same using stem (for discrete time signal).
2. Apply the left shift and Right shift on the signal in step 2.
3. Define the unit step signal and plot the same using stem (for discrete time signal).
4. Apply Time shift, Reversal and Scaling on the signal in step 5 and plot them in a
single window.
5. Define the rectangular pulse and plot the same using plot (for continuous time signal).
6. Repeat the step no 6 for the step no 7.
*****************************
PART B
Grade :
Discrete:
clc;
clear all;
n=-10:10;
l=length(n);
x1=zeros(1,l);
x1(1,11)=1;
subplot(3,3,1);
stem(n,x1);
title('impulse');
xlabel('n');
ylabel('x[n]');
n1=input('enter positive value to right shift');
subplot(3,3,2);
stem((n+n1),x1);
title('right shift');
xlabel('n');
ylabel('x[n]');
n2=input("enter negative value to left shift");
subplot(3,3,3);
stem((n+n2),x1);
title("left shift");
xlabel("n");
ylabel("x[n]");
x2=zeros(1,l);
x2(1,11:l)=1;
subplot(3,3,4);
stem(n,x2);
title('unit step function');
xlabel('n');
ylabel('x[n]');
n3=input('enter positive value to right shift');
subplot(3,3,5);
stem((n+n3),x2);
title('right shift');
xlabel('n');
ylabel('x[n]');
n4=input('Enter negative value of left shift');
subplot(3,3,6);
stem((n+n4),x2);
title('left shift');
xlabel('n');
ylabel('x[n]');
subplot(3,3,7);
stem(-n,x2);
title('reversed function');
xlabel('n');
ylabel('x[n]');
n5=input('enter values to compress(greater than 1 input');
subplot(3,3,8);
stem((n/n5),x2);
xlabel('n');
ylabel('x[n]');
n6=input('enter value to expand(less than 1 input');
subplot(3,3,9);
stem((n/n6),x2);
title('expand signal');
xlabel('n');
ylabel('x[n]');
Continuous
clc;
clear all;
t=-10:0.1:10;
n=input('enter values of width =');
m=rectpuls(t,n);
subplot(3,2,1);
plot(t,m);
xlabel('t');
ylabel('a');
title('rectangular pulse');
grid on;
subplot(3,2,4);
plot(-t,m);
title('reversed function');
xlabel('t');
ylabel('a');
Discrete
Input:
OUTPUT
Continuous
Input
Output
B.3 Conclusion:
We have successfully learned to Apply operations (Time shift, Reversal and Scaling) using
discrete and continuous time signals.