0
$\begingroup$

I've been attempting to stabilise an unstable filter (unfortunately, I cannot redesign the filter in a way that it is more stable and that is NOT an option). It is derived from an approximation of actual physical components, which I know very little about, and certain fixed values for those are used to obtain a LaPlace domain equation. This is then put through the bilinear transform and we get digital filter coefficients. I apologize for the lack of code as I simply cannot post it here; there are 4 parameters that control the generation of the s-domain filter transfer function. The program loops through all parameter values and generates coefficients for each configuration.

As you will see here, I even tried to inline the polystab implementation (the lines that are commented out), and I can see the roots of the denominator (ie, the poles) being greater than or equal to 1. After reflecting them back inside the unit circle you can see the poles are now less than 1. I've checked my syntax for passing on the polynomial coefficients to polystab multiple times, and I'm sure the syntax is correct. As seen in the attached pictures, the result of polystab doesn't change anything. Is there something fundamental that I just can't see? Even the result of isstable remains 0 even after putting the denominator polynomial through polystab. HELP!

Numerator polynomial coefficients (ie, zeros)

Denominator polynomial coefficients (ie, poles)

Denominator polynomial coefficients after being put through polystab

        
                result = isstable( numD, denD );               
                % result = stabilitycheck( denD' );
                
                if result == 0

                    % for roots calculation denD needs to be flipped, for
                    % polystab it is fine as is.

                    %arr = flip(denD);
                    %v = roots(arr);
                    %vs = 0.5*(sign(abs(v)-1)+1);
                    %newv = (1-vs).*v + vs./conj(v);
                    %newconfig = arr(1) * poly(newv);

                    newconfig = polystab(denD);

                    scale = abs( sum(newconfig) / sum(denD) );
                    numD = numD .* scale;

                    res = isstable(numD, newconfig);

                    if( res == 0 )
                        err_config(index, :) = [ B M T I ];
                        index = index + 1;
                    end
                           
                end
                
                
            end
            
        end
        
    end
    
end
$\endgroup$
2
  • 1
    $\begingroup$ Is denD a polynomial in the s-domain or in the z-domain? $\endgroup$
    – Matt L.
    Jul 13, 2022 at 7:52
  • $\begingroup$ Hello Matt, denD contains the z-domain coefficients; all the coefficient data from the pictures is in the z-domain. Cheers! $\endgroup$
    – Kartikeya
    Jul 13, 2022 at 9:02

1 Answer 1

0
$\begingroup$

The coefficients denD shown in the table correspond to a polynomial with a zero at $z=1$, resulting in a marginally stable filter if used as the denominator polynomial of the transfer function. Reflecting poles across the unit circle circle - which is what polystab does - won't help because there's no pole outside the unit circle, just right on the unit circle.

What you can do is move the pole at $z=1$ slightly inside the unit circle, i.e., replace it with a pole at $z=r$, $0\ll r<1$, and compute the corresponding polynomial coefficients using poly.

$\endgroup$
2
  • $\begingroup$ Thanks for the swift response! When I was calculating the roots (in the commented out script), I reckon the part where I flip the matrix is incorrect, because without doing that the poles are on or just within the unit circle. The zplane plot now confirms that. What gets me is that the isstable function reported it as unstable; it must have been marginally stable! Problem is, for certain input parameter values it actually DOES get unstable as I can see the magnitude response growing infinitely. I suppose your suggestion of shifting the pole slightly would still apply for those cases, right? $\endgroup$
    – Kartikeya
    Jul 13, 2022 at 12:30
  • $\begingroup$ @Kartikeya: Yes, if you have a real-valued pole at (or close to) $z=1$, just replace it by a pole at $z=r$ with $r$ close to (but smaller than) $1$. $\endgroup$
    – Matt L.
    Jul 13, 2022 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.