Web Simulation

 

 

 

Interactive Z-Transform Visualizer

Objective. This tool helps you explore the Z-transform and discrete-time LTI systems by placing poles (x) and zeros (o) on the Z-plane. The unit circle |z| = 1 corresponds to the frequency axis. You see the magnitude and phase of the frequency response H(e^jw), and the impulse response h[n] from the associated difference equation.

Stability. A system is stable iff all poles lie inside the unit circle (|z| < 1). Any pole with |z| > 1 makes the system unstable; the impulse response grows without bound (we clamp it for display).

Mathematical Foundation

Transfer function. We model the system as a ratio of factored polynomials in z. On the unit circle, z = e, so H(e) gives the frequency response; magnitude |H(e)| is plotted in dB and phase ∠H(e) in degrees:

H(z) = gain · ∏i (z − zeroi) / ∏i (z − polei)

Difference equation. H(z) is converted to polynomial form B(z)/A(z) in z-1. The recurrence y[n] = sumk bk x[n-k] - sumk>0 ak y[n-k] (with a0=1) defines the filter. We drive it with an impulse [1, 0, 0, ...] to obtain the first 100 samples of h[n].

Poles and zeros. Poles attract |H|; near a pole, the magnitude grows. Zeros null |H|; on the unit circle they create notches. Conjugate pairs keep coefficients real and yield symmetric magnitude response.

Simulation

The interactive simulator is below. Use the controls to explore the concepts described above.

Z-Plane: unit circle, poles (x), zeros (o)
Stable

Drag to move; right-click to delete.

Magnitude |H(e^jw)| (dB)
Phase angle H (deg)
Impulse response h[n]
3D: |H(z)| over complex plane (Re, Im)
|H(e^jw)| on unit circle (0 to 2pi)

 

Usage

Preset: Choose a built-in configuration. Order (slider): when a design preset (Butterworth, Chebyshev I/II, Elliptic) is selected, the Order slider appears; set filter order 2-12. Add Pole / Add Zero: place new roots (as conjugate pairs if enabled). Delete: remove the selected pole or zero (click to select). Clear All: remove all. Conjugate pairs: when on, adding or dragging a root updates its mirror. Show phase: toggle the phase plot.

On the Z-plane, drag a pole (x) or zero (o) to move it. Right-click one to delete it. Green = stable (|z| < 1); red = unstable (|z| > 1). Near the unit circle, dashed lines to the cursor suggest the distance interpretation of H(e^jw).

3D plot: Use the rotation step buttons (top) for elevation +/- and azimuth +/-. Use camera presets (bottom): Top, Iso, Front, Side, Bottom. Drag to rotate, scroll to zoom. The white tube traces |H(z)| along the unit circle on the surface.

2D projection: |H(e^jw)| vs angle on the unit circle. Use the overlay buttons to switch the x-axis range between 0 to 2pi and -pi to pi.

Presets

  • Simple Low-Pass: one real pole (r=0.8). Smooths; |H| falls at high w.
  • Narrow Bandpass (Resonator): conjugate pole pair at r=0.9, +/-45 deg. Sharp peak at w=pi/4; impulse rings.
  • Notch: zeros on the unit circle at 90 deg; poles inside. Deep null at w=pi/2.
  • High-Pass: pole at z=-1, zero at origin. Attenuates low w; h[n] alternates.
  • Unstable: conjugate poles with r=1.1. |H| and h[n] grow; plot clamped.
  • Butterworth LP: maximally flat passband; poles only. Order 2-12.
  • Chebyshev I LP: passband ripple; steeper rolloff. Order 2-12.
  • Chebyshev II LP: stopband ripple; zeros on unit circle. Order 2-12.
  • Elliptic LP: ripple in both bands; sharpest transition. Order 2-12.

Key Concepts

  • Z-plane: Re(z) horizontal, Im(z) vertical. Unit circle |z|=1 for frequencies 0 to pi (Nyquist).
  • Stability: all poles inside |z|<1. Any pole with |z|>1 gives unbounded h[n].
  • Frequency response: H(e^jw) = B(e^jw)/A(e^jw). Magnitude in dB; phase in degrees.
  • Impulse response: from difference equation with input delta[n]; clamped when unstable.
  • 3D plot: |H(z)| in dB over Re(z) and Im(z). Fine mesh (101×101), −120 dB range. Rotation step buttons (top): elevation +/-, azimuth +/-. Camera presets (bottom): Top, Front, Side, Iso, Bottom. Drag to rotate, scroll to zoom. White tube = unit circle trace (|H| along |z|=1 on the surface).
  • 2D projection: |H(e^jw)| vs angle on the unit circle (0 to 2pi, or -pi to pi). Overlay buttons switch the x-axis range.

Limitations

  • Rational, LTI discrete systems only. The model is a ratio of polynomials in z with a finite set of poles/zeros. Time-varying, nonlinear, or multi-rate systems are out of scope.
  • Finite impulse-response window. The difference equation is driven by an impulse for only the first ~100 samples and is clamped when unstable, so long-tail or marginally stable responses are truncated rather than shown exactly.
  • Limited order and dynamic range. Order is capped (2–12) and the 3D magnitude is drawn over a finite Z-plane mesh (101×101) with a −120 dB clamp, so very sharp poles/zeros are visually saturated.
  • Idealized coefficients. Computations use full-precision arithmetic with no coefficient quantization, rounding, or limit-cycle effects that affect real fixed-point DSP implementations; conjugate symmetry is assumed for real coefficients.
  • Frequencies 0 to Nyquist. The unit-circle trace covers 0 to π (and its mirror); sampling-rate context, aliasing, and the mapping to physical Hz are left to the user.
  • Teaching tool. Built to build intuition for poles/zeros, stability (|z| < 1), and the Z-plane → frequency-response relationship — not a filter-design or DSP-implementation package.