[bug #68196] Wrong phase in bode plot
"Dmitri A. Sergatskov" <[email protected]>
| Newsgroups | gmane.comp.gnu.octave.bugs |
|---|---|
| Message-ID | <[email protected]> |
Please use the bug tracker to post updates to a bug report. The mailing list is intended as a read-only notification stream. Info posted to this mailing list address won't appear in the tracker database where it is most useful.
Follow-up Comment #2, bug #68196 (group octave):
I might be wrong but to me it looks like a bug in `bode.m`.
Continuous time integrator is `1/z` but for discrete
it is `1/(z-1)`. So bode should count poles at `1` for discrete system. So
change:
n_poles_at_origin = sum (all_poles{h} == 0);
n_zeros_at_origin = sum (all_zeros{h} == 0);
asymptotic_low_freq_phase = (n_zeros_at_origin - n_poles_at_origin)*90;
to
if (isct (sys1))
## Continuous systems have integrators at s = 0
n_poles_at_origin = sum (abs (all_poles{h}) < eps);
n_zeros_at_origin = sum (abs (all_zeros{h}) < eps);
else
## Discrete systems have integrators at z = 1
n_poles_at_origin = sum (abs (all_poles{h} - 1) < eps);
n_zeros_at_origin = sum (abs (all_zeros{h} - 1) < eps);
endif
asymptotic_low_freq_phase = (n_zeros_at_origin - n_poles_at_origin)*90;
?
Dmitri.
--
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68196>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHQEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCacrW1AAKCRCqLAuaBUf3 TmXbAPjFLseeXCsQ0+IMySYx9aZgHzi+Os1HBsUuFJ7jNFuaAQCbd2ejzMWkQMzc sUqYt3AfOPQvFmSp972WHhWWD37GBQ== =evJh -----END PGP SIGNATURE-----