0% found this document useful (0 votes)
22 views9 pages

Expanding and Inversion) On Signals

The document describes various mathematical operations that can be performed on signals in Matlab, including shifting, scaling, inversion, addition, subtraction, multiplication, and division of signals. It provides code examples to demonstrate how to apply each of these operations by defining signals using functions like cosine, sine, and plotting the resulting waveforms. The objective is to practically apply common signal properties and mathematical operations on signals using the Matlab software environment.

Uploaded by

Mohsin Iqbal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views9 pages

Expanding and Inversion) On Signals

The document describes various mathematical operations that can be performed on signals in Matlab, including shifting, scaling, inversion, addition, subtraction, multiplication, and division of signals. It provides code examples to demonstrate how to apply each of these operations by defining signals using functions like cosine, sine, and plotting the resulting waveforms. The objective is to practically apply common signal properties and mathematical operations on signals using the Matlab software environment.

Uploaded by

Mohsin Iqbal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Lab. NO.

: 04

Properties of signals and Mathematical Operation on Signals in Matlab

Lab. Objective: To practically apply the properties of signals (shifting, scaling, compressing,
expanding and inversion) on signals.

Tools: PC, Matlab Software.

Shifting of signal

Shifting of signal is to give a shift to the signal either on right side or on left side.

Left shifting of waveform

%% shifting of signal on left side%%

%Definig the time interval

t=0:.001:10;

%Defining the waveform

y=2*cos(t);

%Plotting the wave form with one unit shift

plot(t-1,y)

1.5

0.5

-0.5

-1

-1.5

-2
-1 0 1 2 3 4 5 6 7 8 9

Right shift of Signal

%% shifting of signal on left side%%

%Definig the time interval


t=0:.01:10;

%Defining the waveform

y=4*sin(t);

%Plotting the wave form with two unit shift

plot(t+2,y)

-1

-2

-3

-4
2 3 4 5 6 7 8 9 10 11 12

Inversion Of signal

%% Inversion of signal%%

%Definig the time interval

t=0:.01:10;

%Defining the waveform

y=-sin(t);

%Plotting the wave form with inversion

plot(t,y)

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 1 2 3 4 5 6 7 8 9 10

Maximizing the amplitude of a waveform


%% Increasing amplitude of signal%%

%Definig the time interval

t=0:.01:10;

%Defining the waveform with increment operator of amplitude

y=10*sin(t);

%Plotting the wave form

plot(t,y)

10

-2

-4

-6

-8

-10
0 1 2 3 4 5 6 7 8 9 10

Minimizing the amplitude of a waveform

%% Decreasing amplitude of signal%%

%Definig the time interval

t=0:.01:10;

%Defining the waveform with decrement operator of amplitude

y=1/6*sin(t);

%Plotting the wave form

plot(t,y)
0.2

0.15

0.1

0.05

-0.05

-0.1

-0.15

-0.2
0 1 2 3 4 5 6 7 8 9 10

Expanding of signals

%% Expanding of signal%%

%Definig the time interval

t=0:.01:10;

%Defining the waveform

y=4*sin(t);

%Plotting the wave form

plot(3*t,y)

-1

-2

-3

-4
0 5 10 15 20 25 30

Compressing of signals

%% Compressing of signal%%

%Definig the time interval

t=0:.01:8;

%Defining the waveform


y=4*cos(t);

%Plotting the wave form with compressing factor

plot(t/12,y)

-1

-2

-3

-4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7

Flipping of signals

Flipping of signal is to change the time axis of a signal from positive X-axis to negative x-axis OR from
negative x-axis to positive x-axis.

Negative flipping of signal

%% Flipping of signal from positive to negative x-axis%%

%Definig the time interval

t=0:.01:8;

%Defining the waveform

y=9*cos(t);

%Plotting the wave form with flipping

plot(-t,y)
10

-2

-4

-6

-8

-10
-8 -7 -6 -5 -4 -3 -2 -1 0

Positive flipping of signal

%% Flipping of signal from negative to positive x-axis%%

%Definig the time interval

t=-8:.01:0;

%Defining the waveform

y=9*cos(t);

%Plotting the wave form with positive flipping

plot(-t,y)

10

-2

-4

-6

-8

-10
0 1 2 3 4 5 6 7 8

Mathematical operation on signals

Addition of two signals

%% Addition of two signals%%

%Definig the time interval for both signals

t=0:.01:6;

%Defining the first waveform

y1=9*cos(t);
%Defining the second waveform

y2=2*sin(t)

%Adding both the signals

y3=y1+y2;

%Plotting the wave form with positive flipping

plot(t,y3)

10

-2

-4

-6

-8

-10
0 1 2 3 4 5 6

Subtraction of two waveforms

%% Subtraction of two signals%%

%Definig the time interval for both signals

t=0:.01:6;

%Defining the first waveform

y1=9*cos(t);

%Defining the second waveform

y2=11*sin(t)

%subtracting both the signals

y3=y1-y2;

%Plotting the wave form with positive flipping

plot(t,y3)

Multiplication of two signals


15

10

-5

-10

-15
0 1 2 3 4 5 6

%% Multiplication of two signals%%

%Definig the time interval for both signals

t=0:.01:6;

%Defining the first waveform

y1=2/3*cos(t);

%Defining the second waveform

y2=5*sin(t)

%Multiplyiong both the signals

y3=y1.*y2;

%Plotting the waveform

plot(t,y3)

1.5

0.5

-0.5

-1

-1.5

-2
0 1 2 3 4 5 6

Division of two signals

%% Division of two signals%%

%Definig the time interval for both signals


t=0:.01:6;

%Defining the first waveform

y1=2/3*cos(t);

%Defining the second waveform

y2=5*sin(t)

%Dividing both the signals

y3=y1./y2;

%Plotting the waveform

plot(t,y3)

20

-20

-40

-60

-80

-100
0 1 2 3 4 5 6

Lab Assignment:

Plot the following waveform in Matlab

Y=A/Bcos(2t-3/A)+C*D^Etan(-t/E+2)

You might also like