In Mixed-Signal Circuits, Part 1: From *s* to *z* - The Discrete Complex-Frequency Domain, discrete-time analog circuit analysis introduced the *z*-domain, a simple shortcut from discrete time-domain equations to the sampled *s*, or *s**-domain. In this part, we push forth to transfer functions in *s* and *z* of ADCs and DACs, then consider briefly how to design feedback loops that span the analog-digital boundary.

Part 1 left us hanging as to how impulse trains relate to discrete-time waveforms. The development continues, and in the concrete context of ADCs, so that the abstraction of impulses can have a clearer meaning.

**ADC Dynamics in z**

To demonstrate how the *z*-domain can be applied in circuit engineering, a 12-bit ADC transfer function is

where *v _{ADC}* is the input voltage,

The right-side expression can be interpreted as the gain-normalized integration (1/*s* x *T _{s}*) of an impulse train in the time domain, resulting in a sequence of step functions, each turned off

The acquired continuous voltage waveform, *v _{i}*(

The ADC sample-hold frequency response is the magnitude and phase of *T _{ZOH}*(

The main step in this derivation is to multiply numerator and denominator by * e ^{-jω Ts}*/2, then apply (from Euler’s equation,

The amplitude of *T _{ZOH}*(

This function begins with a value of one at zero frequency (
*ω
* = 0 s^{–1}) and decreases to zero at the sampling frequency. Then it “bounces” (because of the absolute value) between zero values at harmonics of *f _{s}*, outside the Nyquist interval. The rolloff of magnitude with frequency can be compensated with an inverse ZOH (ZOH

The phase is

In degrees, the phase is −180^{o}(*f*/*f _{s}*), where

At the Nyquist frequency, *f _{s}*/2, the magnitude will have decreased to (sin(
π
/2))/(
π
/2) = 2/
π
≈
0.637 with a phase delay of −180

We arrive at the final step, the ZOH function, which completes the transformation from *z* to *s*:

Thus, to transform from *z* to *s*, substitute *z*(*s*) = exp(*sT _{s}*) for

**Discrete-Time Control in w**

**Discrete-Time Control in w**

There is a way (yet another transform) which avoids the complication of doing control analysis in *z*. Then *z* is used only as a quick way to get from discrete *t* to *s**. Control design of feedback loops can be worked out as though the feedback system were continuous, then convert to the discrete domains using the *bilinear transform*, *w* (*z*), to account for sampling effects. We now have four domains: *t*, *s*, *z*, and *w*. The *w*-transform maps the left half-plane of *s* onto the unit circle of *z* so that whatever is stable in *s* is stable in *z* (within the unit circle) and *t* and whatever is unstable in *s* is unstable in *z* and *t*. The new quantity, *w*, has units of frequency and behaves more like *s* than *z*, which is unitless. Stability analysis in *s* applies to *w*. Indeed, *w*
≈
*s*;

As 1/*s*T_{s} is a continuous integrator in *s*, 1/*w*T_{s} is a trapezoidal integrator in the time domain. If *w*(*z*) were inverse-*Z* transformed from *z* to *t*, it would be a trapezoidal integrator, what in numerical analysis (which, by the way, is equivalent to DSP, expressed more in mathematical than engineering language) is Euler’s integration rule; the two endpoints of an interval to be integrated are averaged in value and multiplied by the time interval, *T _{s}*.

Then for *s* = *j
ω
*,

Substitute this into the *w*(*z*) transform;

Then the *s*-domain steady-state frequency, *ω*, is related to its corresponding frequency in *w* of *ω _{w}* by

The desired poles and zeros of a continuous function of *f* can be *prewarped* to *f _{w}* values before applying frequency-response analysis by substituting the

where *f _{w}* =

**From z to Discrete-Time Equations**

To illustrate the use of the *w*-domain, a common motor-drive feedback-loop compensator is the PID transfer function, *y*(*z*)/*e*(*z*), from Part 1, where *e* is the feedback-loop input error, implemented here by converting to the *z*-domain the three terms of

Substituting *w*(*z*) for *s* and simplifying,

This can be solved for the outputs of *y*(*z*) by first rewriting

to express the *z* quantities as delays of one sampling cycle or computed iteration, *z*^{–1}. Then

The time-domain difference equations to be implemented in computer code follow by applying (apart from initial conditions) the time-shifting transform from *z* to discrete-time *t* = *nT _{s}* :

For *y _{D}*(

For the remaining two terms,

where in general, *x*(*n* − *k*) is the *k*th previous sample point of *x* from the *x*(*n*) of the *n*th sample point and iteration that is presently being computed. These three difference equations can be implemented directly in software, keeping in mind that if *n* corresponds to the present iteration of the computation loop in time, then the *n* − 1 samples are from the previous iteration last time through the loop. The combined output, *y*(*z*), is the sum of the three outputs. Usually, these iterations of *y*(*n*) computations are implemented as interrupt-driven by a timer that produces regular *T _{s}* intervals.

If the *f _{s}* /

**Summary**

The *z* discrete-sequence and *w* discrete-frequency domains add some further complication to electronics that take sampling into account. Happily, mastery of the different rules of dynamics in the *z*-domain can be largely avoided by using it as a shortcut between the discrete-time and sampled-frequency domains. If design values of poles and zeros in *s* for loop frequency compensation are to be implemented in the
μ
C, then the *w*-domain is another shortcut in that *w* is an approximate, sampling-affected *s*. Prewarping from *s* to *w* and using the bilinear formula of *
ω
_{w}* result in

As μ
C-based systems continue to proliferate, *digital signal processing* and *discrete control* have become commonplace and an essential part of the electronics engineering body of knowledge. The concepts of this brief tutorial on discrete-time circuit analysis - of sampling by ADCs and DACs - is an increasingly important and familiar part of the working knowledge of the analog engineer of mixed-signal electronics.

Copyright © 2019 TechWeb, A UBM Company, All rights reserved.