0% found this document useful (0 votes)
19 views3 pages

Computer Assignment 1 19ECE203 Signals and Systems

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)
19 views3 pages

Computer Assignment 1 19ECE203 Signals and Systems

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/ 3

Amrita Vishwa Vidyapeetham

Amrita School of Engineering, Bengaluru


Department of Electronics and Communication Engineering

19ECE203: Signals and Systems


***For every question, submit code snippets and the resulting outputs and figures, etc.***

A. Introduction to MATLAB

1. a) Create a row vector x with elements 1, 2, 9, -2, 4, 3, -6, and a column vector y with the same
sequence of elements.
b) Use length(x) and find the length of vector x.
c) Find the transpose of x and y. What do you observe?
d) Find x.*x.

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

3. Explore the in-built functions sqrt, sin, cos, exp, log10, log, in MATLAB and use them to
compute the following:

√"#$ ( ( '#%*
a) p = 2 b) q = log (e5) + log10 (102) c) r = sin2 ( ) ) + cos2 ( ) ) d) s = '&%*
√%&'

e) w = ejπ/4 and f) u = eπ/2j.

4. Create a vector t = 0:0.001:2 , find x1 = sin(2π10t) and x2 = cos(2π20t).


a) Plot the signals x1 and x2 versus t in two figure windows. (Hint: Use commands plot, xlabel,
ylabel)
b) Plot the signals x1 and x2 versus t in the same figure window. (Hint: Use commands subplot,
plot)

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)
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.

C. Generation of Sequences - II

Generate impulse, step, and ramp signals (continuous time & discrete time) using:

a. Logical operations

b. Function files.

D. Basic operations on signals

1. Generate a signal x(t) = 3sin(10πt)e-5t for 0 ≤ t ≤ 2, and perform the following operations:

(a) y1(t) = x(–t)


(b) y2(t) = x(t–3)
(c) y3(t) = x(t+2)
(d) y4(t) = x(t/2)
(e) y5(t) = x(2t)

Hint: Use commands as subplot(), plot(), legend(), axis(), grid(), etc.

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.


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].

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.

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.

x(t)
h(t)
*
1
1

t t
-1/2 1/2 -1 1

You might also like