Lab Report1
Lab Report1
Solution: Here question (a) is a delta signal, to plot this delta signal in MATLAB
we use a custom delta function. Question (b) continuous signal, also there is part
w(n) which is Gaussian random sequence, to plot this we use “randn” MATLAB
built-in function.
Example 1.4: Generate and plot the samples (use the stem function) of
the following sequence using MATLAB:
10
(a) x1 (n ) = (m + 1)(n − 2m ) − (n − 2m − 1); 0 n 25
m =0
(b) x(n) = (0.8) , 0 n 9 , one periodic, plot 10 periods
n
Solution: This section question (a) signal is a summation of a delta function with
a range of 0 n 25 also there is a range of m (0 to 10), to calculate this signal
we use a for loop to mention the range of m.
Question (b) is a real valued exponential sequence, so if we want to plot this
function in MATLAB, we need a custom function to generate the sequence. To
generate this sequence of 10 periods we use the MATLAB built-in function
“repmat”, which repeats the periods in 10 periods.
Operation on DT Sequences:
Custome function for Operation on DT Sequences:
This section also we need some custom function to perform some mathematical
operation like addition, multiplication, shifting, folding, decomposition, etc. We
need to build a custom function because MATLAB has no elementary built-in
function.
Lab Evaluation:
ILE1.1: Using the evenodd function, decompose the following
sequences into their even and odd components. Plot these components
Solution: In mathematics, even functions and odd functions are functions that
satisfy particular symmetry relations, concerning taking additive inverses. They
are important in many areas of mathematical analysis, especially the theory of
power series and Fourier series.
ILE1.2: Let x(n) = {1, −2, 4, 6, −5,8,10} . Generate and plot the samples
of the following sequence: y(n) = x(n + 4) x(n − 1) + 4 x(n + 4) + 3 x(n)
Home Work:
1. Generate and plot the samples (use the stem function) of the following
sequence using MATLAB: x1 (n) = 3x(n + 2) + x(n − 4) − 2 x(n) where
x(n) = {1,−2,6,−5,4,6,8,10} Hint: Use “sigadd” & “sigshift” functions.
Solution: This signal is under Operation on DT Sequences, here the x1(n) signal
has a shifting and addition function and the x(n) signal set the position of shifting
the position of the sequence, also this arrow sign means the position of zero
states.
2. (a) A unit ramp DT signal r(n) is defined as,
n n0
r ( n) =
0 n0
(b) Use the above sequence to plot a ramp sequence for the interval -10 to 10.
Solution: ramp( x ) creates a ramp signal wave with a slope of 1 and returns the
value of the ramp at time x. To generate the ramp signal we use a custom-built
ramp function.
Solution: This signal need Operation on DT Sequences and a for loop to generate
the signal. Here for loop is used to calculate the equation of the signal under the
condition.
ii)
Summary: To process the analog signal by digital, we need to convert them into
digital signals. This process is called Analog-to-Digital conversion. In this lab
session, we use some analog continuous signals to convert DT signals. Some of
them need a custom function to perform, some use MATLAB built-in functions.
This lab session includes some separate parts like, mathematically part and
generates, manipulate, and plot discrete-time signals using, generation of DT
signals and some for Operation on DT Sequences.