0% found this document useful (0 votes)
39 views11 pages

Analog and Digital Communication

Uploaded by

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

Analog and Digital Communication

Uploaded by

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

ANALOG AND DIGITAL COMMUNICATION

LAB EXPERIMENTS

NAME: -
BRANCH: - ELECTRICAL AND ELECTRONICS
REGISTRATION NUMBER: -
SUBJECT: - ANALOG AND DIGITAL
COMMUNICATION LAB
EXPERIMENTS
(A.D.C]
INDEX
S.NO. EXPERIMENT EXPERIMENT SUBMISSION
DATE DATE
MATLAB, which stands for MATrix LABoratory, is a state-of-the-art mathematical software package,
which is used extensively in both academia and industry. It is an interactive program for numerical
computation and data visualization, which along with its programming capabilities provides a very
useful tool for almost all areas of science and engineering. Unlike other mathematical packages, such
as MAPLE or MATHEMATICA, MATLAB cannot perform symbolic manipulations without the use of
additional Toolboxes. It remains however, one of the leading software packages for numerical
computation. MATLAB is interactive software which has been used recently in various areas of
engineering and scientific applications. It is not a computer language in the normal sense but it does
most of the work of a computer language. Writing a computer code is not a straightforward job,
typically boring and time consuming for beginners. One attractive aspect of MATLAB is that it is
relatively easy to learn. It is written on an intuitive basis and it does not require in-depth knowledge
of operational principles of computer programming like compiling and linking in most other
programming languages. This could be regarded as a disadvantage since it prevents users from
understanding the basic principles in computer programming. The interactive mode of MATLAB may
reduce computational speed in some applications.The power of MATLAB is represented by the length
and simplicity of the code. For example, one page of MATLAB code may be equivalent to many pages
of othercomputer language source codes. Numerical calculation in MATLAB uses collectionsof well-
written scientific/mathematical subroutines such as LINPACK and EISPACK. MATLAB provides
Graphical User Interface (GUI) as well as three-dimensional graphical animation.In general, MATLAB
is a useful tool for vector and matrix manipulations.Since the majority of the engineering systems are
represented by matrix and vector equations, we can relieve our workload to a significant extent by
using MATLAB.The finite element method is a well-defined candidate for which MATLAB can be very
useful as a solution tool. Matrix and vector manipulations are essential parts in the method. MATLAB
provides a help menu so that we can type the help command when we need help to figure out a
command. The help utility is quite convenient for both beginners and experts. Application of MATLAB
There is a wide range of areas where MATLAB tools are applied. These areas include mathematics,
physics, chemistry and chemical engineering, mechanical engineering, biological (molecular biology)
and medical sciences, communication and control systems, digital signal, image and video
processing,

Application of MATLAB There is a wide range of areas where MATLAB tools are applied. These areas
include mathematics, physics, chemistry and chemical engineering, mechanical engineering,
biological (molecular biology) and medical sciences, communication and control systems, digital
signal, image and video processing,

system modeling and simulation. Many interesting problems have been included throughout the
book, and its contents will be beneficial for students and professionals in wide areas of interest.
S.NO. COMMAND SYNTAX/CODE

1 clc clc
clc clears all input and output from the Command Window
display, giving you a "clean screen."

2 clear all clear all ;


clear all removes all variables from the workspace,
releasing them from system memory

3 close all close all;


close all deletes all figures whose handles are not hidden.

for for index = values


4 program statements
:
end
for index=values, program statements, end repeatedly
executes one or more MATLAB statements in a loop. values
has one of the following forms
1)initval:endval increments the index variable from initval
to endval by 1, and repeats execution of program
statements until index is greater than endval.
2) initval:step:endval increments index by the value step on
each iteration, or decrements when step is negative.
5 help
help functionName

Displays information and documentation


about a function
6 Ismac
ismac Checks if MATLAB is running on a macOS
platform
7 system system('Command')
Executes a system Command from within MATLAB

8 isvarname isvarname('variableName')
Checks if a string is a valid MATLAB variable name

9 isunix isunix
Checks if MATLAB is running on a UNIX-like platform

10 quit Quit
Terminates the MATLAB session

11 while while expression


program statements
:
end
while expression, program statements, end repeatedly executes one
or more MATLAB program statements in a loop, continuing until
expression no longer holds true or until MATLAB encounters a break,
or return instruction, thus forcing an immediate exit of the loop
code. If MATLAB encounters a continue statement in the loop code, it
interrupts execution of the loop code at the location of the continue
statement, and begins another iteration of the loop at the while
expression statement.
12 If if expression,
statements
end
if expression, statements, end evaluates expression and, if the
evaluation yields logical 1 (true) or a nonzero result, executes one or
more MATLAB commands denoted here as statements.
The if function can be used alone or with the else and elseif
functions. When using elseif and/or else within an if statement, the
general form of the statement is
if expression1
statements1
else
if expression2
statements2
else
statements3
13 input evalResponse = input(‘prompt’)

evalResponse = input(prompt) displays the prompt string on the screen,


waits for input from the keyboard, evaluates any expressions in the
input, and returns the value in evalResponse.

14 disp disp(X)

disp(X) displays an array, without printing the array name. If X contains a


text string, the string is displayed. Another way to display an array on
the screen is to type its name, but this prints a leading "X=," which is
not always desirable. Note that disp does not display empty arrays.
15 plot plot(Y)
plot(X,Y)
plot(Y) plots the columns of Y versus the index of each value when Y is a
real number.Gives a continuous plot.
plot(X,Y) plots Y vs X

16 stem stem(Y)
stem(X,Y)
stem(Y) plots the data sequence Y as stems that extend from equally
spaced and automatically generated values along the x-axis. When Y is a
matrix, stem plots all elements in a row against the same x value.
stem(X,Y) plots X versus the columns of Y. X and Y must be vectors or
matrices of the same size. Additionally, X can be a row or a column
vector and Y a matrix with length(X) rows.
Gives a discrete plot
17 subplot subplot(m,n,p) or subplot(mnp)

subplot(m,n,p) or subplot(mnp) breaks the figure window into an m-by-


n matrix of small axes, selects the pth axes object for the current plot,
and returns the axes handle. The axes are counted along the top row of
the figure window, then the second row, etc.
18 Xlabel xlabel('string')
Ylabel ylabel('string')
zlabel zlabel('string')

Each axes graphics object can have one label for the x-, y-, and z-axis.
The label appears beneath its respective axis in a two-dimensional plot
and to the side or beneath the axis in a three-dimensional plot.

xlabel('string') labels the x-axis of the current axes. ylabel(...) and


zlabel(...) label the y-axis and z-axis, respectively, of the current axes.
19 legend legend('string1','string2',...)
legend places a legend on various types of graphs (line plots, bar
graphs, pie charts, etc.). For each line plotted, the legend shows
a sample of the line type, marker symbol, and color beside the
text label you specify. When plotting filled areas (patch or
surface objects), the legend contains a sample of the face color
next to the text label. The font size and font name for the legend
strings match the axes FontSize and FontName properties.
legend('string1','string2',...) displays a legend in the current axes
using the specified strings to label each set of data.
20 max C = max(A)
C = max(A,B)
C = max(A) returns the largest elements along different
dimensions of an array. If A is a vector, max(A) returns the
largest element in A.

C = max(A,B) returns an array the same size as A and B with the


largest elements taken from A or B. The dimensions of A and B
must match, or they may be scalar.
21 min C = min(A)
C = min(A,B)
C = min(A) returns the smallest elements along different
dimensions of an array. If A is a vector, min(A) returns the
smallest element in A. C = min(A,B) returns an array the same
size as A and B with the smallest elements taken from A or B.
The dimensions of A and B must match, or they may be scalar.
22 length
numberOfElements = length(array)
numberOfElements = length(array) finds the number of
elements along the largest dimension of an array. array is an
array of any MATLAB data type and any valid dimensions.
numberOfElements is a whole number of the MATLAB double
class.
23 sqrt B = sqrt(X)
B = sqrt(X) returns the square root of each element of the array
X. For the elements of X that are negative or complex, sqrt(X)
produces complex results

24 exp Y = exp(X)
The exp function is an elementary function that operates
element-wise on arrays. Its domain includes complex numbers.
Y = exp(X) returns the exponential for each element of X.
25 abs abs(X)

abs(X) returns an array Y such that each element of Y is the


absolute value of the corresponding element of X. If X is
complex, abs(X) returns the complex modulus (magnitude),
which is the same as sqrt(real(X).^2 + imag(X).^2)
title title('string')
Each axes graphics object can have one title. The title is located at the
top and in the center of the axes.
26
EXPERIMENT NO: - 1
Object: Write a MATLAB program to generate the following sequence.

A. Unit Sample Sequence [(n)].


B. Unit Step Sequence [ (n) (n-m) ].
C. Unit Ramp Sequence
D. Sine Wave
E. Cosine Wave

Theory:

A: Unit Sample Sequence [ (n)].

Definition-

The Dirac delta function, or δ function, is (informally) a generalized function on the real number line
that is zero everywhere except at zero, with an integral of one over the entire real line. The delta
function is sometimes thought of as an infinitely high, infinitely thin spike at the origin, with total
area one under the spike

(n) = {∞0 ,,xx=0


≠0

and which is also constrained to satisfy the identity

B: Unit Step
sequence
[μ(n)]
Defination-
The unit step function is just a piecewise function with a jump discontinuity at t = a.
Recall from calculus that a jump discontinuity is an x-value for which the limit doesn’t
exist. Then general form of the unit step function is given below.

Mu(t-a) = 0, t<a

=M, t>a

The M in the function represents the height of the jump


and a is the number of units shifted to the right.
C: Unit Ramp Sequence
Definition--The ramp function may be defined analytically in several ways. Possible definitions

are:

D:Sine
Wave
Definitio
n- y=
sinx

E:Cosine

Wave

Definition -
Source code:

You might also like