Skip to content

Commit 623ca94

Browse files
committed
Changed implementation of the limitation of evaluated frequencies for
discrete systems to be conform with existing tests (/control/tests/discrete_test.py). But the question remains: What distance to the Nyquist frequency is appropriate?
1 parent 5d56788 commit 623ca94

2 files changed

Lines changed: 52 additions & 50 deletions

File tree

control/freqplot.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ def bode_plot(syslist, omega=None, omega_num=None, dB=None, Hz=None, deg=None,
137137
if sys.isdtime(True):
138138
nyquistfrq = 2. * np.pi * 1. / sys.dt / 2.
139139
omega_sys = omega_sys[omega_sys < nyquistfrq]
140-
nyquistfrq_limit = nyquistfrq - (omega_sys[-1] - omega_sys[-2]) / 2. # floating point!
141-
omega_sys = omega_sys[omega_sys < nyquistfrq_limit] # in two steps to get the right increment
140+
# TODO: What distance to the Nyquist frequency is appropriate?
142141
else:
143142
nyquistfrq = None
144143
# Get the magnitude and phase of the system
@@ -432,7 +431,9 @@ def default_frequency_range(syslist, Hz=None, number_of_samples=None, feature_pe
432431
features_ = features_[features_ != 0.0];
433432
features = np.concatenate((features, features_))
434433
elif sys.isdtime(strict=True):
435-
freq_interesting.append(np.pi * 1. / sys.dt)
434+
fn = np.pi * 1. / sys.dt
435+
#TODO: What distance to the Nyquist frequency is appropriate?
436+
freq_interesting.append(fn*0.9)
436437
p = sys.pole()
437438
p = p[p != -1.]
438439
features = np.concatenate((features, np.abs(np.log(p) / sys.dt)))

0 commit comments

Comments
 (0)