0% found this document useful (0 votes)
11 views

SAS File D-1

This document contains a lab practical file submitted by a student for the subject Signals & Systems. It includes 7 experiments aimed at introducing concepts like singular functions, trigonometric functions, even and odd signals, complex exponential signals, and convolution. The experiments include the aim, theory, code snippets in Octave/MATLAB, and corresponding figures for each concept covered.

Uploaded by

adi3349kumar
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)
11 views

SAS File D-1

This document contains a lab practical file submitted by a student for the subject Signals & Systems. It includes 7 experiments aimed at introducing concepts like singular functions, trigonometric functions, even and odd signals, complex exponential signals, and convolution. The experiments include the aim, theory, code snippets in Octave/MATLAB, and corresponding figures for each concept covered.

Uploaded by

adi3349kumar
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/ 15

UNIVERSITY INSTITUE OF ENGNIEERING AND TECHNOLOGY

KURUKSHETRA UNIVERSITY, KURUKSHETRA

LAB PRACTICAL FILE

of

SIGNALS & SYSTEMS


SUBMITTED TO: - SUBMITTED BY:-
Ms. Kirti saini Akshit
Assistant Professor ECE-A 3rd Sem
ECE, UIET, KUK Roll No. – 252201050
EXPERIMENT NO:1

AIM: Introduction to OCTAVE

THEORY:

What is OCTAVE?

Octave is an open-source software that serves as an alternative to MATLAB. It is


commonly used for numerical computing, equation solving, and creating visualizations.
Octave is a powerful tool for various applications in fields like mathematics, engineering,
and scientific research.

How to start OCTAVE

To launch Octave on different platforms:

Mac: Double-click on the Octave icon.

PC: Go to the "Programs" menu in the "Start" menu, open the "Octave" submenu, and
select "Octave".

Unix: In the terminal, type "octave" and press enter.

To exit Octave, type "exit" in the command window.

In Octave, you'll find a user-friendly environment with menus, buttons, and a command
window. You can use the command window to execute commands, run programs, and
perform mathematical calculations. Octave also provides helpful functions and features
for scientific computing and graphing. It's a versatile tool for various applications.

In the Octave command window, you'll see a prompt that looks like >>. You can type your
commands immediately after this prompt. After typing the command, press <enter> to
execute it. If you need to interrupt a command that Octave is running, you can type <ctrl> +
<c>.
In Octave, the commands you type in the command window are also stored in
the Command History. To repeat a command, you can double-click on it in the
history window or use the <up arrow> at the prompt to iterate through the
previously used commands.

Octave, like MATLAB, can be used as a calculator. For example, to compute 5


sin(2.53-pi)+1/75, you can simply type 5*sin(2.53-pi)+1/75 at the prompt.
Remember to use parentheses correctly and include * for multiplication.

Just like MATLAB, Octave is also case-sensitive. It distinguishes between


lowercase and uppercase letters. For example, Octave will understand sin(2) but
not Sin(2).
EXPERIMENT-2

AIM: To study singular functions

clc;
clear all;
t=-10:0.1:10;
%continuous unit impluse function
imp=[zeros(1,100),1,zeros(1,100)]
subplot(3,2,1)
plot(t,imp)
xlabel(‘time’)
ylabel(‘imp(t)’)
title(‘continuous unit impluse function’)
%discrete unit impluse function
n=-10:1:10;
impd=[zeros(1,10),1,zeros(1,10)]
subplot(3,2,2)
stem(n,impd)
xlabel(‘time interval’)
ylabel(‘imp[n]’)
title(‘discrete unit impluse function’)
%continous unit step function
stp=[zeros(1,100),1,zeros(1,101)]
subplot(3,2,3)
plot(t,stp)
xlabel(‘time’)
ylabel(‘stp(t)’)
title(‘continuous unit step function’)
%discrete unit step function
stpd=[zeros(1,10),1,zeros(1,11)]
subplot(3,2,4)
stem(n,stpd)
xlabel(‘time interval’)
ylabel(‘step[n]’)
title(‘discrete unit step function’)
%continous ramp function
rmp=t.*stpd
subplot(3,2,5)
plot(t,rmp)
xlabel(‘time’)
ylabel(‘ramp[n]’)
title(‘discrete ramp function’)
%discrete ramp function
rmpd=n.*stpd
subplot(3,2,6)
stem(n,rmpd)
xlabel(‘time’)
ylabel(‘ramp[n]’)
title(‘discrete ramp function’)

FIGURE:
EXPERIMENT-3

AIM: To study trignometric functions

clc;
clear all;
t=0:0.1:2*pi;
a1=sin(t);
subplot(3,2,1)
plot(t,a1)
xlabel("Time")
ylabel("Amplitude")
title("Sine function")
a2=cos(t);
subplot(3,2,2)
plot(t,a2)
xlabel("Time")
ylabel("Amplitude")
title("Cosine function")
a3=tan(t);
subplot(3,2,3)
plot(t,a3)
xlabel("Time")
ylabel("Amplitude")
title("Tangent function")
a4=cot(t);
subplot(3,2,4)
plot(t,a4)
xlabel("Time")
ylabel("Amplitude")
title("Cotangent function")
a5=csc(t);
subplot(3,2,5)
plot(t,a5)
xlabel("Time")
ylabel("Amplitude")
title("Cosecant function")
a6=sec(t);
subplot(3,2,6)
plot(t,a6)
xlabel("Time")
ylabel("Amplitude")
title("Secant function")
FIGURE:
EXPERIMENT-4

AIM: To determine even and odd signals


% to determine and plot even and odd parts of a signal
clc;
clear all;
t=-10:1:10;
x=[zeros(1,10),ones(1,11)]
xeven=0.5*[x+fliplr(x)]
xodd=0.5*[x-fliplr(x)]
subplot(3,1,1)
plot(t,x)
xlabel(“time”)
ylabel(“x(t)”)
title(“original signal”)
subplot(3,1,2)
plot(t,xeven)
xlabel(“time”)
ylabel(“xeven”)
title(“even signal”)
subplot(3,1,3)
plot(t,xodd)
xlabel(“time”)
ylabel(“xodd”)
title(“odd signal”)
FIGURE:
EXPERIMENT – 5

AIM: To visualize the complex exponential signal and real sinusoids.

% Define the signal


t = 0:1:10; % Time vector
x = 5+(j.*3); %Complex number

% Exponential signal
y = exp(x.*t);

% Real part
real_part = real(y);

% Imaginary part
imaginary_part = imag(y);

% Phase magnitude
phase_magnitude = angle(y);

%Absolute value
absolute_value=abs(y);

% Plotting the results


subplot(3,2,1);
stem(t,y);
title('Complex Signal');
xlabel('Time');
ylabel('Amplitude');

subplot(3,2,2);
stem(t, imaginary_part);
title('Imaginary Part');
xlabel('Time');
ylabel('Amplitude');

subplot(3,2,3);
stem(t, real_part);
title('Real Part');
xlabel('Time');
ylabel('Amplitude');

subplot(3,2,4);
stem(t, absolute_value);
title('Absolute value');
xlabel('Time');
ylabel('Amplitude');

subplot(3,2,5);
stem(t, phase_magnitude);
title('Phase Magnitude');
xlabel('Time');
ylabel('Amplitude');

FIGURE:
EXPERIMENT-6

AIM: To demonstrate the convolution and correlation of two continuous-


time signals

clc;
clear all;
i=[1,2,3];
j=[4,5,6];
m=i.*j
subplot(2,2,1)
plot(m)
xlabel('Time')
ylabel('Amplitude')

k=conv(i,j)
subplot(2,2,2)
plot(k)
xlabel('Time')
ylabel('Amplitude')

subplot(2,2,3)
stem(m)
xlabel('Time')
ylabel('Amplitude')

subplot(2,2,4)
stem(k)
xlabel('Time')
ylabel('Amplitude')
FIGURE:
EXPERIMENT-7

AIM: To demonstrate the circular-convolution of two discrete signals.

clc;
clear all;
x=[1,2,3,4]
subplot(2,2,1)
stem(x)
xlabel("Time")
ylabel("Amplitude")
title("X")
y=[5,6,7,8]
subplot(2,2,2)
stem(y)
xlabel("Time")
ylabel("Amplitude")
title("Y")
z=cconv(x,y)
subplot(2,2,3)
stem(z)
xlabel("Time")
ylabel("Amplitude")
title("Circular convolution of X and Y")
FIGURE:

You might also like