Mouse-based tool for sketching and fitting
[sysout,pts] = drawmag(data) [sysout,pts] = drawmag(data,init_pts)
uses the mouse in the plot window to create
sysout (a stable minimum-phase
which approximately fits the frequency response (magnitude) in
Either a frequency response object that is plotted as a reference, or a constant matrix of the form [xmin xmax ymin ymax] specifying the plot window on the data.
Frequency response of points.
drawmag is running, all interaction
with the program is through the mouse and/or the keyboard. The mouse,
if there is one, must be in the plot window. The program recognizes
Clicking the mouse button adds a point at the cross-hairs.
If the cross-hairs are outside the plotting window, the points are
plotted when the fitting, windowing, or replotting mode is invoked.
a is the same as clicking the mouse button.
r removes the point with
frequency nearest that of the cross-hairs.
Typing any integer between
the existing points with a transfer function of that order. The fitting
routine approximately minimizes the maximum error in a log sense.
The new fit is displayed along with the points, and the most recent
previous fit, if it exists.
w uses the cross-hair location
as the initial point in creating a window. Moving the cross-hairs
and clicking the mouse or pressing any key then gives a second point
at the new cross-hair location. These two points define a new window
on the data, which is immediately replotted. This is useful in fine
tuning parts of the data. You can call windowing repeatedly.
p simply replots the data
using a window that covers all the current data points as well as
whatever was specified in
in. Typically used after
windowing to view all the data.
k invokes the keyboard using
keyboard command. Be cautious when using this
option to avoid unintended changes to variables.