Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

# polystab

Stabilize polynomial

b = polystab(a)

## Description

polystab stabilizes a polynomial with respect to the unit circle; it reflects roots with magnitudes greater than 1 inside the unit circle.

b = polystab(a) returns a row vector b containing the stabilized polynomial, where a is a vector of polynomial coefficients, normally in the z-domain.

## Examples

expand all

### Convert Linear-Phase Filter to Minimum-Phase

Design an FIR filter of order 25 and normalized cutoff frequency 0.4 using the window method. Verify that it has linear phase but not minimum phase.

h = fir1(25,0.4);

h_linphase = islinphase(h), h_minphase = isminphase(h)

h_linphase =

1

h_minphase =

0



Use polystab to convert the linear-phase filter into a minimum-phase filter.

hmin = polystab(h)*norm(h)/norm(polystab(h));

hmin_linphase = islinphase(hmin), hmin_minphase = isminphase(hmin)

hmin_linphase =

0

hmin_minphase =

1



Verify that the two filters have the same magnitude response.

[phh,w] = phasez(h);   magh = 20*log10(abs(freqz(h)));

phhmin = phasez(hmin); maghmin = 20*log10(abs(freqz(hmin)));

subplot(2,1,1), plot(w/pi,phh, w/pi,phhmin),  ylabel 'Phase (degrees)'
subplot(2,1,2), plot(w/pi,magh,w/pi,maghmin), ylabel 'Magnitude (dB)'
xlabel 'Radian Frequency (\omega/\pi)', legend('h','hmin')


expand all

### Algorithms

polystab finds the roots of the polynomial and maps those roots found outside the unit circle to the inside of the unit circle:

v = roots(a);
vs = 0.5*(sign(abs(v)-1)+1);
v = (1-vs).*v + vs./conj(v);
b = a(1)*poly(v);