A newer version of Max is available. Click here to access the latest version of this document.

zplane~

Graph filter poles and zeros on the Z-plane

Description

The zplane~ object, like the filtergraph~ object, does not process audio signals by itself, but it does react internally to the current MSP sampling rate. It provides a way to graph filter poles and zeros in the Z-plane for display. You can use the zplane~ object in conjunction with the filtergraph~ object, or provide it with a list of biquad~ coefficients. The zplane~ object is designed to help in digital filter design and visualization for MSP, and to provide a basic pedagogical tool which may be used to help explain digital filter theory.
You can change the filter parameters by clicking and dragging on the zplane~ object’s display. Clicking and dragging on any of the poles (shown as an x in the display) or zeros (shown as an o in the display) will modify the filter coefficients and output the new filter coefficient values.

Arguments

None.

Messages

bang Causes the current pole and zero values to be re-output.
float biquad-filter-coefficients [float]
In 1st-5th inlets: A float in one of the first five inlets changes the current value of the corresponding biquad~ filter coefficients (a0, a1, a2, b1, and b2, respectively), recalculates and displays the filter's pole-zero graph on the Z-plane and causes a lists of poles and zeros be output.
  (inlet1) coefficient value [float]
In 2nd inlet: Sets the current value of the biquad~ filter's a1 coefficient.
  (inlet2) coefficient value [float]
In 3rd inlet: Sets the current value of the biquad~ filter's a2 coefficient.
  (inlet3) coefficient value [float]
In 4th inlet: Sets the current value of the biquad~ filter's b1 coefficient.
  (inlet4) coefficient value [float]
In 5th inlet: Sets the current value of the biquad~ filter's b2 coefficient.
list biquad-filter-coefficients [list]
In left inlet: A list of five float values which correspond to biquad~ filter coefficients sets the zplane~ object's internal values for these coefficients and causes the object to visually display the poles and zeros for the filter(s) and to output the pole and zero data.

If more than five values are sent, they are interpreted as sets of cascaded biquad coefficients. The zplane~ object will display a composite pole-zero graph which shows the multiplication of a group of biquad filters in cascade. Up to 24 groups of five float values may be cascaded.
(mouse) You can change the filter parameters by clicking and dragging on the zplane~ object’s display. Clicking and dragging on any of the poles (shown as an x in the display) or zeros (shown as an o in the display) will modify the filter coefficients and output the new filter coefficient values.
logscale 0/1 [int]
The word logscale, followed by a zero or one, toggles between linear (the default) and log frequency display.
order number-of-poles/zeros [int]
The word order, followed by an even number between 2 and 24, sets the number of poles and zeros.
range visual scaling amount [float]
The word range, followed by a floating point value, changes the visual scaling of the zplane~ object's display. The default is 1.5.

Attributes

Name Type g/s Description
axiscolor float Sets the X and Y axis color of the zplane~ object in RGBA format.
bgcolor float Sets the background color of the zplane~ object in RGBA format.
bordercolor float Sets the object border color of the zplane~ object in RGBA format.in RGBA format.
circlebordercolor float Sets the Unit Circle border color of the zplane~ object in RGBA format.
fgcolor float Sets the foreground (unit circle) color of the zplane~ object in RGBA format.
gridlinecolor float Sets the grid line color of the zplane~ object in RGBA format.
hlcolor float Sets the idle mousing highlight color of the zplane~ object in RGBA format.
pconstrain int
def.:0
When set to 1, poles will be constrained inside the unit circle, and thus yield a stable filter. An argument of zero will turn this feature off (the default).
polezerocolor float Sets the Pole and Zero color of the zplane~ object in RGBA format.
rounded int
def.:8
Sets the roundness, in pixels, of the zplane~ object box.

Information for box attributes common to all objects

Output

list: Out left outlet: a list of 5 floating-point filter coefficients for the biquad~ object. Coefficients output in response to mouse clicks and changes in the coefficient inlets.

Out second outlet: a list of "zero" location values expressed as complex numbers (real, imaginary). These correspond to the "a" coefficients of the filter. A 2nd order (biquad) filter will have 2 zeros, a 4th order filter will have four, etc...

Out third outlet: a list of "pole" location values expressed as complex numbers (real, imaginary). These correspond to the "b" coefficients of the filter. A 2nd order (biquad) filter will have 2 zeros, a 4th order filter will have four, etc...

Out fourth outlet: a list of floating-point values representing the overall gain of each cascaded filter.

Examples

See Also

Name Description
biquad~ Two-pole, two-zero filter
cascade~ Cascaded series of biquad filters
filtercoeff~ Signal-rate filter coefficient generator
filtergraph~ Graphical filter editor