(BL - EN.U4ECE22022) Sandeep-Signals and Systems Assignment
(BL - EN.U4ECE22022) Sandeep-Signals and Systems Assignment
Submitted by
of
BACHELOR OF TECHNOLOGY
IN
“ELETRONICS AND COMMUNICATION”
ENGINEERING
NOVEMBER-2023
Code:-
Output:-
2. Create two 3×3 matrices A and B with elements (1 4 1; 2 3 4; -1 6 7) and (7 4 2;3 5 6; -1 2 1) and
determine the following.
a) A + B
b) A.*B
c) A*B
d) A(:, 3)
e) B(1:2, : )
f) AT + 2BT
Ans:-
Code:-
Output:-
3. Explore the in-built functions sqrt, sin, cos, exp, log10, log, in MATLAB and use them to compute the
following:
a) p=2*((3^(1/2)+2)/(5^(1/2)-1))
b) q = log(exp(5)) + log10(10^2)
c) r = sin(pi/6)^2 + cos(pi/6)^2
d) s = (1 + 5i) / (1 - 5i)
e) w = exp(1i*pi/4)
f) u = exp(pi/2*1i)
Ans:-
Code:-
Output:-
Ans:-
Code:-
Output:-
5. Explore the working following built-in functions in MATLAB (submit code showing how each of the
functions is to be used and show output) abs(x), cos (x), sin(x), tan(x), ceil(x), fix(x), floor(x), round(x),
char(x), eye(), ones(), zeros(), real(x), mag(x)
Ans:-
Code:-
Output:-
B. Generation of Sequences – I
Generate the following signals and plot them using MATLAB.
a. A continuous-time sinusoidal signal, x(t) = 2sin(2πt+φ) for 0 ≤ t ≤ 4 for phase, φ = 0 and π.
b. A discrete-time sinusoidal signal with a fundamental period N=10, for -20 ≤ n ≤ 20.
c. A rectangular pulse with a pulse width of 2.
d. A triangular waveform with a time-period of 0.5 sec for -2 ≤ t ≤ 2, with peak value occurring at p = 0.8.
e. A continuous-time exponential waveform, y(t) = e-t, 0 ≤ t ≤ 5 and a discrete time exponential signal, x[n]
= an, where a = 0.8 and 0 ≤ n ≤ 25.
Hint: Use functions sin(), rectpuls(), sawtooth(), exp(), stem(), figure(), plot(), legend(), xlabel(), ylabel(),
subplot(), grid(), etc.
Ans:-
a. A continuous-time sinusoidal signal, x(t) = 2sin(2πt+φ) for 0 ≤ t ≤ 4 for phase, φ = 0 and π.
Code:-
Output:-
b. A discrete-time sinusoidal signal with a fundamental period N=10, for -20 ≤ n ≤ 20.
Code:-
Output:-
Output:-
d. A triangular waveform with a time-period of 0.5 sec for -2 ≤ t ≤ 2, with peak value occurring at p = 0.8.
Code:-
Output:-
e. A continuous-time exponential waveform, y(t) = e-t, 0 ≤ t ≤ 5 and a discrete time exponential signal, x[n]
= an, where a = 0.8 and 0 ≤ n ≤ 25.
Code:-
For continuous-time
For discrete time
Output:-
For continuous-time
Output:-
For continuous-time
For discrete time
b. Function files.
Code:-
For continuous-time
For discrete time
Output:-
For continuous-time
Code:-
Output:-
2. Verify whether the following signals are even, odd or neither even nor odd, by decomposing the signals
into their even and odd components. For each signal, generate a figure window and plot the signal, it’s even
and odd parts using subplots.
(a) x1(t) = 5cos[(π/8)t]
(b) x2(t) = 4sin[(π/6)t]
(c) x3(t) = e-2t for 0 ≤ t ≤ 2.
Ans:-
Even Signal:( x_e(t) = 1/2[x(t)+x(−t)]
Odd Signal:( x_o(t) =1/2[x(t)-x(−t)]
(a) x1(t) = 5cos[(π/8)t]
x1(-t)= 5cos[-(π/8)t]= 5cos[(π/8)t](cosine is an even function)
x1e(t)= 1/2[5cos[(π/8)t] + 5cos[-(π/8)t] ]= 5cos[(π/8)t] (even)
x1o(t)= 1/2[5cos[(π/8)t] - 5cos[-(π/8)t] ]= 0 (odd)
So, ( x1(t) ) is an even signal.
(b) x2(t) = 4sin[(π/6)t]
x2(-t)= 4sin[-(π/6)t]=- 4sin[(π/6)t](sine is an odd function)
x2e(t)= 1/2[4sin[(π/6)t]+ 4sin[-(π/6)t]]= 0 (even)
x2o(t)= 1/2[4sin[(π/6)t] - 4sin[-(π/6)t]]= 4sin[(π/6)t] (odd)
So, ( x2(t) ) is an odd signal.
(c) x3(t) = e-2t for 0 ≤ t ≤ 2.
Since ( x3(t) ) is a decaying exponential function, it is neither even nor odd.
In summary:
( x1(t) ) is an even signal.
( x2(t) ) is an odd signal.
( x3(t) ) is neither even nor odd.
Code:-
Output:-
E. Convolution
1. Find the output of an LTI system characterized by impulse response h[n] = [1, 2, -1, 2, 3, -4,], when the
input signal is x[n] = [1, 0.5, -1, 3, -6, 4, 3, 5]. Numbers in bold are signal values at the time origin n = 0.
Use subplot to plot the input signal x[n], impulse response h[n], and output signal y[n].
Ans:-
Code:-
Output:-
>> E1
h= 1 2 -1 2 3 -4
n_x = 0 1 2 3 4 5 6 7
n_h = 0 1 2 3 4 5
n_y = 0 1 2 3 4 5 6 7
>>
2. Find y(t) = x(t) * h(t) with x(t) = u(t) – u(t-4) and h(t) = u(t+2) – u(t-2), t = -10:10. Use subplot to plot the
input signal, impulse response of the system, and output signal
Ans:-
Code:-
Output:-
3. Find y(t) = x(t) * h(t) where x(t) and h(t) are as shown below. Use subplot to plot input signal x(t),
impulse response of the system h(t) and output signal
Ans:-
Code:-
Output:-