Main Content

yulewalk

Recursive digital filter design

Description

example

[b,a] = yulewalk(n,f,m)returns the transfer function coefficients of annth-order IIR filter whose frequency magnitude response approximately matches the values given infandm.

Examples

collapse all

Design an 8th-order lowpass filter with normalized cutoff frequency 0.6. Plot its frequency response and overlay the response of the corresponding ideal filter.

f = [0 0.6 0.6 1]; m = [1 1 0 0]; [b,a] = yulewalk(8,f,m); [h,w] = freqz(b,a,128); plot(w/pi,mag2db(abs(h))) yl = ylim; holdonplot(f(2:3),yl,'--') xlabel('\omega/\pi') ylabel('Magnitude') grid

Figure contains an axes object. The axes object with xlabel omega / pi, ylabel Magnitude contains 2 objects of type line.

Increase the stopband attenuation by specifying a wider transition band.

f = [0 0.55 0.6 0.65 1]; m = [1 1 0.5 0 0]; [b,a] = yulewalk(8,f,m); h = freqz(b,a,128); holdonplot(w/pi,mag2db(abs(h))) holdoffylim(黄)

Figure contains an axes object. The axes object with xlabel omega / pi, ylabel Magnitude contains 3 objects of type line.

Input Arguments

collapse all

Filter order, specified as a positive integer scalar.

Data Types:single|double

Frequency points, specified as a vector of points in the range between 0 and 1, where 1 corresponds to the Nyquist frequency, or half the sample rate. The first point off必须是0,最后一点吗1. All intermediate points must be in increasing order.fcan have duplicate frequency points corresponding to steps in the frequency response.

Example:[0 0.25 0.4 0.5 0.5 0.7 1]specifies an irregularly sampled Nyquist range.

Data Types:single|double

Magnitude response, specified as a vector containing the desired responses at the points specified inf.mmust be the same length asf.

Example:(0 1 1 1 0 0 0)specifies a bandpass magnitude response.

Data Types:single|double

Output Arguments

collapse all

Filter coefficients, returned as row vectors. The output filter coefficients are ordered in descending powers ofz:

B ( z ) A ( z ) = b ( 1 ) + b ( 2 ) z 1 + + b ( n + 1 ) z n a ( 1 ) + a ( 2 ) z 1 + + a ( n + 1 ) z n .

Tips

When specifying the frequency response, avoid excessively sharp transitions from passband to stopband. You may need to experiment with the slope of the transition region to get the best filter design.

Algorithms

yulewalkdesigns recursive IIR digital filters using a least-squares fit to a specified frequency response. The function performs the fit in the time domain.

  • To compute the denominator coefficients,yulewalkuses modified Yule-Walker equations, with correlation coefficients computed by inverse Fourier transformation of the specified frequency response.

  • To compute the numerator,yulewalkfollows these steps:

    1. Compute a numerator polynomial corresponding to an additive decomposition of the power frequency response.

    2. Evaluate the complete frequency response corresponding to the numerator and denominator polynomials.

    3. Use a spectral factorization technique to obtain the impulse response of the filter.

    4. Obtain the numerator polynomial by a least-squares fit to this impulse response.

References

[1] Friedlander, B., and Boaz Porat. "The Modified Yule-Walker Method of ARMA Spectral Estimation."IEEE®Transactions on Aerospace Electronic Systems. Vol. AES-20, Number 2, 1984, pp. 158–173.

Extended Capabilities

Version History

Introduced before R2006a