You are on page 1of 6

EXP NO: VARIOUS SIGNAL OPERATIONS ON DISCRETE TIME SIGNALS

DATE:

AIM:
To generate the signal and perform signal operations.

SOFTWARE REQUIRED:
MATLAB R2015a.

THEORY:
Discrete time signals are the signals or quantities that can be defined and represented at
certain time instants of the sequence. These are finite or countable sets of number sequences.
They are also called digitalized signals.

TIME SHIFTING:
Time shifting means, shifting of signals in the time domain. Mathematically, it can be
written as, x(t)→y(t+k)-This K value may be positive or it may be negative. According to the
sign of k value, we have two types of shifting named as Right shifting and Left shifting. Case 1
K>0-When K is greater than zero, the shifting of the signal takes place towards "left" in the time
domain. Therefore, this type of shifting is known as Left Shifting of the signal. Case 2 K<0-When
K is less than zero the shifting of signal takes place towards right in the time domain. Therefore,
this type of shifting is known as Right shifting.

TIME SCALING:
If a constant is multiplied to the time axis then it is known as Time scaling. This can be
mathematically represented as; x(t)→y(t)=x(αt) or x(t/α); where α ≠ 0. So the y-axis being same,
the x- axis magnitude decreases or increases according to the sign of the constant whether positive
or negative. Therefore, scaling can also be divided into two categories as discussed below.

Time Compression
Whenever alpha is greater than zero, the signal’s amplitude gets divided by alpha whereas
the value of the Y-axis remains the same. This is known as Time Compression.

Time Expansion
When the time is divided by a constant alpha, the Y axis magnitude of the signal get
multiplied alpha times, keeoing X-axis magnitude as it is. Therefore, this is clled time expansion
type signal.

TIME REVERSAL:
Whenever signal’s time is multiplied by -1, it is known as time reversal of the signal. In
this case, the signal produces its mirror image about Y-axis. Mathematically, this can be written
as;
x(t)→y(t)→x(−t)
PROGRAM
clc;
clear all;
close all;
%generation of x[n]
n=-1:1:4; % Range of x axis
x=[2 4 6 -1 3 5]; % input sequence
axis([-12 12 -5 5]);
subplot(3,2,1);
stem(n,x,'linewidth',1); % graph of n vs x
xlabel('n');% title for x-axis
ylabel('x[n]');%title for y-axis
title('x[n]'); %title for graph
grid on;

%generation of x[n-3]
subplot(3,2,2);
stem (n+3,x,'linewidth',1);
xlabel('n');
ylabel('x[n-3]');
title('x[n-3]');
grid on;

%generation of x[n+2]
subplot(3,2,3);
stem (n-2,x,'linewidth',1);
xlabel('n');
ylabel('x[n+2]');
title('x[n+2]');
grid on;

%generation of x[-n]
subplot(3,2,4);
stem (-n,x,'linewidth',1);
xlabel('n');
ylabel('x[-n]');
title('x[-n]');
grid on;

%generation of x[2-n]
subplot(3,2,5);
stem (-(n-2),x,'linewidth',1);
xlabel('n');
ylabel('x[2-n]');
title('x[2-n]');
grid on;

%generation of x[-3-n]
subplot(3,2,6);
stem (-(n+3),x,'linewidth',1);
xlabel('n');
ylabel('x[-3-n]');
title('x[-3-n]');
grid on;
figure;
subplot(3,2,1);
stem(n/2,x,'linewidth',1); % graph of (n/2) vs x
xlabel('n'); % title for x-axis
ylabel('x[2n]'); % title for y-axis
title('x[2n]'); % title for graph
grid on;

%generation of x[2n+2]
subplot(3,2,2);
stem(((n-2)/2),x,'linewidth',1);
xlabel('n');
ylabel('x[2n+2]');
title('x[2n+2]');
grid on;

%generation of x[-2n+2]
subplot(3,2,3);
stem((-(n-2)/2),x,'linewidth',1);
xlabel('n');
ylabel('x[-2n+2]');
title('x[-2n+2]');
grid on;

%generation of x(n/2)
subplot(3,2,4);
stem(2*n,x,'linewidth',1);
xlabel('n');
ylabel('x[n/2]');
title('x[n/2]');
grid on;

%generation of (x[n/2]+2)
subplot(3,2,5);
stem((n-2)*2,x,'linewidth',1);
xlabel('n');
ylabel('x[n/2]+2');
title('x[n/2]+2');
grid on;

%generation of x(-n/2)
subplot(3,2,6);
stem(-2*n,x,'linewidth',1);
xlabel('n');
ylabel('x[-n/2]');
title('x[-n/2]');
figure;

%generation of x[-2n]
subplot(3,2,1);
stem(-n/2,x,'linewidth',1);
xlabel('n');
ylabel('x[-2n]');
title('x[-2n]');
grid on;

%generation of x[2n-2]
subplot(3,2,2);
stem(((n+2)/2),x,'linewidth',1);
xlabel('n');
ylabel('x[2n-2]');
title('x[2n-2]');

%generation of x[-2n-2]
subplot(3,2,3);
stem(-(n-2)/2,x,'linewidth',1);
xlabel('n');
ylabel('x[-2n-2]');
title('x[-2n-2]');
grid on;

%generation of (x[n/2]-2)
subplot(3,2,4);
stem((n+2)*2,x,'linewidth',1)
xlabel('n');
ylabel('x[n/2]-2');
title('x[n/2]-2');
grid on;
%generation of (x[-n/2]-2)
subplot(3,2,5);
stem(-(n+2)*2,x,'linewidth',1);
xlabel('n');
ylabel('x[-n/2]-2');
title('x[-n/2]-2');
grid on;

%generation of (x[-n/2]+2)
subplot(3,2,6);
stem(-(n-2)*2,x,'linewidth',1);
xlabel('n');
ylabel('x[n/2]-2');
title('x[n/2]-2');
grid on;

SIMULATION RESULTS:
RESULT:
Thus various signal operations were performed using matlab

You might also like