Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Computer lab exercises for Digital Signal Processing using ..., Study notes of Digital Signal Processing

Write a MATLAB program that implements the above algorithm to compute the square root of: 16, 4, 5 and 3. How many iterations does it take to converge to ...

Typology: Study notes

2021/2022

Uploaded on 08/05/2022

nguyen_99
nguyen_99 🇻🇳

4.2

(80)

1K documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Spring 2000 EE 6360 1
Homework # 5
Analysis of Discrete-time Signals
Due: March 9, 2000
A. RESPONSE OF DISCRETE-TIME SYSTEMS
1. Write a MATLAB program to determine the response of the following system:
y n x n ay n() . () ( )=+45 1
where a=0.5, and the input signal x(n) is the sinewave, xn n() sin( . )=3202
π
. Assume
zero initial conditions, y(-1)=0. Plot y(n), for n=1, 2, …, 200.
2. Repeat (1) for a=0.9, a=1.2, a=-0.5. What happens when a=1.2? Why?
3. Write a MATLAB program to determine the response of the following system:
yn xn xn xn().().()()=++45 23 2 4 4
where the input signal x(n) is the sinewave, xn n() sin( . )=3202
π
.
4. Square root algorithm
Most computers and calculators compute the square root of a positive number A
using the following recursive algorithm:
yn yn xn
yn
() ( ) ()
()
=−+
1
211
If we use as the input x(n) to this system (algorithm) a step function of amplitude A,
then y(n) will converge after several iterations to the square root of A.
Write a MATLAB program that implements the above algorithm to compute the
square root of: 16, 4, 5 and 3. How many iterations does it take to converge to the true
value assuming y(-1)=0.5? Is the algorithm sensitive to the initial conditions y(-1)?
B. IMPULSE RESPONSE
1. Write a MATLAB program to compute the impulse response of the following
systems:
(a) yn xn yn() . () . ( )=+45 08 1 n=0,1,…,100
Plot the impulse response h(n) using stem(.). Theoretically, what is the
expression for h(n)?
(b) yn xn yn yn xn() () . ( ) . ( ) ( )=+ +05 1 05 4 3
(c ) yn xn xn xn().().()()=++45 23 2 4 4
Plot the impulse response h(n), for n=0,1,…,100.
2. Of the impulse responses computed in (1), which impulse responses are infinite in
duration and which are finite? Which systems are FIR and which systems are IIR?
pf2

Partial preview of the text

Download Computer lab exercises for Digital Signal Processing using ... and more Study notes Digital Signal Processing in PDF only on Docsity!

Spring 2000 EE 6360 1

Homework # 5

Analysis of Discrete-time Signals

Due: March 9, 2000

A. RESPONSE OF DISCRETE-TIME SYSTEMS

  1. Write a MATLAB program to determine the response of the following system: y n ( ) = 4 5. x n ( ) + ay n ( − 1 )

where a=0.5, and the input signal x(n) is the sinewave, x n ( ) = 3 sin( 2 π 0 2. n ). Assume

zero initial conditions, y(-1)=0. Plot y(n), for n=1, 2, …, 200.

  1. Repeat (1) for a=0.9, a=1.2, a=-0.5. What happens when a=1.2? Why?
  2. Write a MATLAB program to determine the response of the following system: y n ( ) = 4 5. x n ( ) + 2 3. x n ( − 2 ) + 4 x n ( − 4 )

where the input signal x(n) is the sinewave, x n ( ) = 3 sin( 2 π 0 2. n ).

  1. Square root algorithm Most computers and calculators compute the square root of a positive number A using the following recursive algorithm:

y n y n

x n y n

If we use as the input x(n) to this system (algorithm) a step function of amplitude A, then y(n) will converge after several iterations to the square root of A.

Write a MATLAB program that implements the above algorithm to compute the square root of: 16, 4, 5 and 3. How many iterations does it take to converge to the true value assuming y(-1)=0.5? Is the algorithm sensitive to the initial conditions y(-1)?

B. IMPULSE RESPONSE

  1. Write a MATLAB program to compute the impulse response of the following systems: (a) y n ( ) = 4 5. x n ( ) + 0 8. y n ( − 1 ) n=0,1,…, Plot the impulse response h(n) using stem(.). Theoretically, what is the expression for h(n)?

(b) y n ( ) = x n ( ) + 0 5. y n ( − 1 ) − 0 5. y n ( − 4 ) + x n ( − 3 ) (c ) y n ( ) = 4 5. x n ( ) + 2 3. x n ( − 2 ) + 4 x n ( − 4 ) Plot the impulse response h(n), for n=0,1,…,100.

  1. Of the impulse responses computed in (1), which impulse responses are infinite in duration and which are finite? Which systems are FIR and which systems are IIR?

Spring 2000 EE 6360 2

C. CONVOLUTION

  1. Write a MATLAB program that implements the convolution sum:

y n x k h n k k

=−∞

for arbitrary input signal x(n) and impulse response h(n). Implement the convolution as a function of the form: y=convol(x,h). The function should take as input arguments the signal vector x(n), and impulse response h(n), and should return the output in the vector y. Assume that the signals x(n), and h(n) are zero for n<0.

  1. Using the convolution program developed in (1), convolve the following sequences: (a)

x n x n

1 2

(b)

x n x n

n n

1 2

0 n 100 0 n 100

  1. Compute the response of the system given in question A(3) using the convolution.