Assignment 1 Signals
Assignment 1 Signals
Assignment 1 Signals
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.
d) Find x.*x.
Code snippet:
Output:
a) A + B
b) A.*B
c) A*B
d) A(:, 3)
e) B(1:2, : )
f) AT + 2BT
Code snippet:
Output:
3. Explore the in-built functions sqrt, sin, cos, exp, log10, log, in MATLAB and use them
a) p = 2 (√3+2)/ (√5-1)
c) r = sin^2(pi/6)+cos^2(pi/6)
d) s =(1+5i)/(1-5i)
e) w = e^jπ/4 and
f) u = e^π/2j.
Code snippet:
Output:
a) Plot the signals x1 and x2 versus t in two figure windows. (Hint: Use commands plot,
xlabel, ylabel)
Output:
5)Explore the working following built-in functions in MATLAB (submit code showing how each of
the
Code snippet:
Output:
B. Generation of sequences- I
Question 6:
d. A triangular waveform with a time-period of 0.5 sec for -2 ≤ t ≤ 2, with peak value
occurring at
p = 0.8.
Generate impulse, step, and ramp signals (continuous time & discrete time) using:
a. Logical operations
b. Function files.
Code snippet:
a) Logical operations
b)Function files
Code snippet:
D. Basic operation on signals
Question 8:
1. Generate a signal x(t) = 3sin(10πt)e-5t for 0 ≤ t ≤ 2, and perform the following operations:
3) (c) y3(t) =
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]
Code snippet:
Question 11:
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.
Code snippet:
OUTPUT:-
Question 12:
Code snippet:
OUTPUT:-