Arma Systems

  • Uploaded by: Mark de Guzman
  • 0
  • 0
  • January 2021
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Arma Systems as PDF for free.

More details

  • Words: 1,670
  • Pages: 15
Loading documents preview...
Digital Signal Processing a.y. 2007-2008

Matlab Laboratory # 2 ARMA systems Giacinto Gelli [email protected]

Giacinto Gelli

DSP Course – 1 / 15

ARMA systems in the time-domain • Solving the difference equation ⇒ command y = filter(b,a,x). ◦ Initial-rest conditions are assumed ⇒ the Matlab system is always causal.

◦ b and a must be row vectors for compatibility with other commands (see

zplane in particular). ◦ y is of the same length of x ⇒ does not account for time-dispersion property of convolution (add zeros instead).

◦ The command does not allow one to explicitly define the time-axis ⇒ the output is defined in the same time instants of the input.

Giacinto Gelli

DSP Course – 2 / 15

Impulse response h[n] and step response g[n] • Method # 1: Define x[n] = δ[n] or x[n] = u[n] and evaluate the outputs

h[n] and g[n] using the command filter. ◦ Exercise: find the impulse/step response of the ARMA systems

y[n] − y[n − 1] + 0.9y[n − 2] = x[n]. Plot the results. Discuss stability and causality.

• Method # 2: use the commands h = impz(b,a) and g = stepz(b,a) (SP Toolbox) (causal responses are found!).

◦ Exercise: rework the previous exercise with impz and stepz and compare the results.

• Note: in recent implementations of the SP Toolbox the command stepz has been deleted. A workaround is to recall the relation existing between h[n] and Pn g[n], i.e., g[n] = k=−∞ h[k], which can be implemented in Matlab using the command cumsum. Giacinto Gelli

DSP Course – 3 / 15

ARMA systems in the Z-domain • Two basic equivalent forms for the transfer function H(z) of ARMA systems:

H(z) =

M X

k=0 N X

bk z −k =



ak z −k

|k=0 {z

b0 a0



M Y

(1 − ck z −1 )

k=1 N Y

(1 − dk z −1 )

k=1

}

polynomial form

|

{z

factorized form

}

• The roots {ck } of the numerator are the zeros of the system. • The roots {dk } of the denominator are the poles of the system. • k = b0 /a0 is the gain of the system for z = ∞. • To pass from one form to the other we use the Matlab commands roots and

poly. Giacinto Gelli

DSP Course – 4 / 15

From polynomial to factorized form • Arrange the coefficients b0 , b1 , . . . , bM and a0 , a1 , . . . , aN in vectors b and

a, respectively. • Evaluate the roots and the gain with the Matlab commands c = roots(b);

d = roots(a); k=b(1)/a(1). • Exercise: put the following H(z) in factorized form

H(z) =

2+3z −1 +4z −2 1+3z −1 +3z −2 +z −3

You should end up with

H(z) = 2

[1−(−0.7500+j1.1990)z −1 ] [1−(−0.7500−j1.1990)z −1 ] (1+z −1 )3

Note: (possible) poles/zeros in z = 0 can be evaluated by the command roots if we add zeros to the shortest between b and a in order to make them the same length. Giacinto Gelli

DSP Course – 5 / 15

From factorized to polynomial form • Use the command poly that evaluates the coefficients of a polynomials starting from its roots.

• Since this polynomial is defined up to a scaling factor, the command poly implicitly assumes that a0 or b0 is equal to one.

• Since k = b0 /a0 , if we let arbitrarily a0 = 1, we get k = b0 . • The following Matlab commands are required: b = k*poly(c); a =

poly(d). • Exercise: rework the previous example starting from k, c, d and obtaining b and a.

• Exercise: write two Matlab functions [k,c,d] = poly2fact(b,a) and

[b,a] = fact2poly(b,a) that implement the previous conversions and test it by calling them in cascade.

Giacinto Gelli

DSP Course – 6 / 15

Pole-zero diagram • The pole-zero diagram of an ARMA system can be evaluated and displayed using the command zplane(b,a).

• Important! b and a must be row vectors (use help zplane for details). • Exercise: write a Matlab script that plots the pole-zero diagram of the system described by the following LCC difference equation:

y[n] − y[n − 1] + 0.9 y[n − 2] = x[n] Discuss the possible ROCs associated to the pole-zero diagrams. Write the analytical expression of the stable and causal impulse response h[n] and compare with the one obtained in Matlab with impz. Discuss the results.

• Exercise: rework the previous exercise with reference to the equation

y[n] + 41 y[n − 1] − 83 y[n − 2] = x[n] + 2x[n − 1] + x[n − 2] Giacinto Gelli

DSP Course – 7 / 15

Partial fraction expansion (1/2) • The partial fraction expansion of H(z) with simple poles and M ≥ N is:

H(z) =

M −N X

Br z

r=0

−r

+

N X k=1

Ak 1 − dk z −1

• If multiple poles are present, to any pole di of multiplicity s it corresponds a sum of s terms like: s X

m=1

Cm (1 − di z −1 )m

• The partial fraction expansion can be obtained with the Matlab command

residuez (SP Toolbox), which can help in the analytical calculation of the partial fraction expansion.

Giacinto Gelli

DSP Course – 8 / 15

Partial fraction expansion (2/2) • The command residuez calculates the poles dk and the coefficients Br , Ak e Cm of the partial fraction expansion.

• The syntax is [r,p,k] = residuez(b,a), where ◦ b (of length M + 1) and a (of length N + 1) are the coefficients of H(z) (as before);

◦ the vector p (of length N ) contains the poles; if a pole with multiplicity s is present, it appears s times in vector p;

◦ the vector r (of length N ) contains the coefficients Ak and Cm of the corresponding poles in p:

◦ the vector k (of length M − N + 1) contains the coefficients Br • If we use the command with the syntax [b,a] = residuez(r,p,k), it performs the reverse operation (useful for checking).

Giacinto Gelli

DSP Course – 9 / 15

Exercise • Consider the following transfer function of a causal ARMA system:

1 + 2z −1 + z −2 H(z) = 1 − 23 z −1 + 12 z −2 (a) Use zplane to observe the pole-zero diagram. Do you expect the system to be stable? (b) Determine with residuez the partial fraction expansion of H(z) and compare with the result obtained by hand. (c) On the basis of the partial fraction expansion, write down the expression of the impulse response h[n]. Compare with the result obtained using impz. (d) Discuss stability on the basis of h[n].

Giacinto Gelli

DSP Course – 10 / 15

The frequency response (1/2) • If the ROC of H(z) includes the unit circle (i.e., the system is stable) the frequency response of an ARMA system can be obtained by evaluating H(z) for z = ejω :

H(ejω ) = H(z)|z=ejω =

M X

k=0 N X

bk e−jωk ak e−jωk

k=0

• In Matlab we use the command freqz to evaluate (and possibly plot) H(ejω ).

Giacinto Gelli

DSP Course – 11 / 15

The frequency response (2/2) • The syntax of freqz is [H,w] = freqz(b,a,L): ◦ for a given L (default value 512) it gives in H the L complex values of

H(ejω ), evaluated for L equispaced values of ω ∈ (0, π), which are collected in vector w; ◦ use plot(w,abs(H)) and plot(w,angle(H)) to plot the result. • When the system is real, the whole spectrum can be extrapolated from

ω ∈ (0π) by Hermitian symmetry. If we want the spectrum in the interval ω ∈ (0, 2π), we can use the modified syntax [H,w] = freqz(b,a,L,’whole’). • With freqz(b,a) we obtain directly the amplitude (in dB) and phase (degrees) in (0, π) and for L = 512.

Giacinto Gelli

DSP Course – 12 / 15

Exercise • Consider the causal and stable system described by

y[n] − y[n − 1] + 0.9 y[n − 2] = x[n] (a) Using the pole-zero diagram, make predictions about the frequency response of the system (LPF? HPF? BPF?) (b) Verify your predictions by evaluating and plotting the frequency response in (0, 2π). (c) Evaluate the speed of response of the system (both analytically and with Matlab).

Giacinto Gelli

DSP Course – 13 / 15

A Matlab contradiction :-) • The command freqz evaluates the frequency response by calculating H(z) on the unit circle, hence it assumes that the system be stable. This assumption can be in contrast with that of the commands filter, impz, and stepz, all of which assume instead that the system be casual.

• Exercise: consider

y[n] − 1.6971y[n − 1] + 1.4400y[n − 2] = x[n] (a) Using the pole-zero diagram, establish the different ROCs and discuss the properties of the different systems involved. (b) Which one of the systems is implemented by filter, impz, and stepz? (c) The system implemented by filter is stable? If not, how do you interpret the frequency response evaluated by freqz? Giacinto Gelli

DSP Course – 14 / 15

My first filter design: notch filter • By placing zeros on the complex plane, design a stable and causal system that is able to perfectly suppress from the signal x[n] = s[n] + d[n] a sinusoidal signal d[n] = cos(2πν0 n), with ν0 = 1/8 (notch filter).

• Test it by generating and filtering a segment of L = 100 samples of d[n]. • Make a plot of the frequency response of the system. Do you think the notch filter will significantly distort the signal s[n]?

• Improve you project by adding poles (where?) in order to “flatten” the frequency response away from the zeros, so that the desired signal s[n] undergos less (amplitude) distortion.

Giacinto Gelli

DSP Course – 15 / 15

Related Documents

Arma Systems
January 2021 0
Arma De Fuego
February 2021 0
28 Dby El Arma Perfecta
January 2021 0
Earthing Systems
January 2021 1
Unmanned Systems
March 2021 0

More Documents from "Jose A. Herrera"

Arma Systems
January 2021 0
Obtencion De Glucogeno
February 2021 1
February 2021 2
Derivatives.pdf
January 2021 1
Damb
January 2021 3