# Signals and Systems/Z-Transform Introduction

## Sampled Systems

Digital signals are by essence sampled signals. In a circuit node, the numbers change at a given rate: the sampling rate or sampling frequency. The time between two changes of the signal is the inverse of the sampling frequency: it is the sampling period.

In processor systems, samples are stored in memory. In logic ciruits, they correspond to register outputs. The sampling period is used to compute the next value of all signals in the system.

Digital circuits are not the only sampled systems: analog circuits such as switched capacitor filters also rely on switches and are sampled too.

## Sampling a signal

### The Nyquist Rate

Sampling a signal raises a major question: does one lose information during this process?

Example: Checking (= sampling) the traffic lights once an hour certainly makes one erratically react to their signalling (= lose information).

On the other side, sampling the traffic lights once per microsecond doesn't bring much more information than sampling it every millisecond.

Obviously, the traffic lights, as any other signals, have to be sampled at a faster rate than they change, but sampling them very much faster doesn't bring more information.

The Nyquist rate is the minimum sampling rate required to avoid loss of information.

${\displaystyle f_{N}\ {\stackrel {\mathrm {def} }{=}}\ 2f_{b}}$

where ${\displaystyle f_{b}}$ is the highest frequency of the signal to be sampled, also called bandwidth.

To avoid losing information, the sampling rate must be higher than the Nyquist rate:

${\displaystyle f_{s}>f_{N}}$

In practice, the sampling rate is taken with some margin, in order to more easily reconstruct the original signal.

Example: audio content sampling rates

The full range of human hearing is between 20 Hz and 20 kHz. Thus, audio content has to be sampled at more than 40 kHz.

And indeed:

• CD audio samples the signals at 44.1 kHz.
• Professional digital video equipment samples them at 48 kHz.
• DVD audio samples them at 96 kHz.
• High end DVD audio doubles this frequency to 192 kHz.

### Aliasing

Sampling a signal with a rate lower than the Nyquist Rate produces aliasing or folding.

Effect of aliasing.

The picture on the right shows a red sinewave of frequency 0.9 (and thus of a period close to 1.1). This signal should be sampled with a frequency larger than 1.8. However, the signal has been sampled with a rate of 1 (vertical lines and black dots). If one tries to draw a line between the samples, the result will look like the blue curve wich is a sinewave of period 10, or of frequency 0.1.

If the signal would have been sampled at a rate of 0.9, the sampling points would always fall on the same point in the sine function and the resulting signal would seem to be a constant.

Sampling a signal of frequency 0.9 with a rate of 1 creates an alias with the frequency of ${\displaystyle 1-0.9=0.1}$.

Sampling a signal of frequency 0.9 with a rate of 0.9 creates an alias at DC, and so with the frequency of ${\displaystyle 0.9-0.9=0}$.

Sampling a signal of frequency 0.9 with a rate of 0.8 also creates an alias with the frequency of ${\displaystyle 0.9-0.8=0.1}$, but with a different phase.

Example: A well known example of aliasing is the stroboscope.

Illuminating a motor turning at a frequency of 90 Hz with a stroboscope switching at 100 Hz gives us the impression that is it turning at 100 Hz - 90 Hz = 10 Hz.

Illuminating a motor turning at a frequency of 90 Hz with a stroboscope switching at 90 Hz gives us the impression that is it standing still.

Illuminating a motor turning at a frequency of 90 Hz with a stroboscope switching at 80 Hz gives us the impression that is it turning at 90 Hz - 80 Hz = 10 Hz, but in the opposite direction.

This is the same effect seen in many American Western movies containing stagecoach scenes. At various rotational rates, the wheels on the stagecoach will appear to rotate forward, stand still, or rotate backward. See Wagon-wheel effect.

It is as if the spectrum of the signal has been folded back down at a point equal to half the sampling frequency.

### Undersampling

Sampling a frequency lower than the Nyquist rate, also called undersampling, creates sinewave aliases at a lower frequency. If the original signal also has content at these lower frequencies, then they will be mixed and there is a loss of information.

However, if the signal has only high-frequency content, then the undersampling process modulates the signal at a lower frequency.

This is a cheap alternative to modulating by the multiplication with a modulation sinewave.

### Oversampling

Oversampling corresponds to sampling with a frequency much higher (typically 100 to 1000) than the Nyquist rate. The interest of oversampling is to be able to represent the signal with a smaller amount of bits.

This can be explained by the mechanism used to gain the additional bits back: a signal sampled at 10 kHz can be downsampled at 5 kHz as long as the new sampling frequency remains greater than the Nyquist frequency. The downsampling implies having two times fewer samples. Rather than throwing every second sample away, one can calculate the mean value of two consecutive samples and use this result to build one sample of the new signal. Calculating the mean value corresponds to add the values and divide them by two. Rather than dividing the result by two and throwing away the bit after the decimal point, one can only add the consecutive samples two by two. With this, the amplitude of the 5 kHz signal is twice the one of the original 10 kHz signal. In other words, it has to be represented by 1 more bits.

A largely used application of oversampling is Pulse Width Modulation (PWM). The modulated signal is represented with a single bit switching at a frequency equal to ${\displaystyle {2^{n}}\cdot f_{N}}$, where ${\displaystyle f_{N}}$ is the Nyquist frequency of the original signal and ${\displaystyle n}$ the number of bits with which it is represented. This one bit signal is ideal to drive high-current loads with a single power switch. PWM is typically used for driving electric motors.

A more complex coding scheme for a result on a single bit is found in every CD player: sigma-delta modulation. There is more theory required for understanding its working. Let us state that it is able to represent a signal on a single bit at a lower sampling frequency than the PWM. On the other hand, the one bit signal switches back and forth more frequently at its sampling frequency and is thus less indicated for driving slower high-current switches. Sigma-delta modulation is used for driving lighter loads such as the cable between the CD player and the audio amplifier.

Example: Super Audio CD (SACD)

The SACD codes the audio in the form of a Direct Stream Digital signal coded on a single bit at 64 times the CD sampling rate of 44.1 kHz.

## Z Transform

The Z Transform is used to represent sampled signals and Linear Time Invariant (LTI) systems, such as filters, in a way similar to the Laplace transform representing continuous-time signals.

### Signal representation

The Z Transform is used to represent sampled signals in a way similar to the Laplace transform representing continuous-time signals.

A sampled signal is given by the sum of its samples, each one delayed by a different multiple of the sampling period. The Laplace transform represents a delay of one sampling period ${\displaystyle T_{s}}$ by:

${\displaystyle z^{-1}{\stackrel {\mathrm {def} }{=}}e^{-sT_{s}}}$

With this, the Z-transform can be represented as

${\displaystyle X(z)={\mathcal {Z}}\{x[n]\}=\sum _{n=0}^{\infty }x[n]z^{-n}}$

where the ${\displaystyle x[n]}$ are the consecutive values of the sampled signal.

### Linear time invariant systems

Continuous-time Linear Time Invariant (LTI) systems can be represented by a transfer function which is a fraction of two polynomials of the complex variable ${\displaystyle s}$.

${\displaystyle H(s)={\frac {num(s)}{den(s)}}}$

Their frequency response is estimated by taking ${\displaystyle s=j\omega }$, this is by estimating the transfer function along the imaginary axis.

In order to ensure stability, the poles of the transfer function (the roots of the denominator polynomial) must be on the left half plane of ${\displaystyle s}$.

Z-plane unit circle

Discrete-time LTI systems can be represented by the fraction of two polynomials of the complex variable ${\displaystyle z}$:

${\displaystyle H(z)={\frac {num(z)}{den(z)}}}$

From the definition:

${\displaystyle z{\stackrel {\mathrm {def} }{=}}e^{sT_{s}}}$

we find that their frequency response can be estimated by taking ${\displaystyle z=e^{j\omega T_{s}}}$, this is by estimating the transfer function around the unit circle.

In order to ensure stability, the poles of the transfer function (the roots of the denominator polynomial) must be inside the unit circle.

### Transfer function periodicity

The transfer function is estimated around the unit circle:

• The point at coordinate ${\displaystyle z=1+j0}$ corresponds to frequency ${\displaystyle f=0}$, which is DC.
• The point at coordinate ${\displaystyle z=0+j1}$ corresponds to frequency ${\displaystyle f=f_{s}/4}$, the quarter of the sampling frequency.
• The point at coordinate ${\displaystyle z=-1+j0}$ corresponds to frequency ${\displaystyle f=f_{s}/2}$, half the sampling frequency.
• The point at coordinate ${\displaystyle z=0-j1}$ corresponds to frequency ${\displaystyle f=3/4f_{s}}$.
• The point at coordinate ${\displaystyle z=1+j0}$ corresponds to frequency ${\displaystyle f=f_{s}}$ which is the sampling frequency.

So having turned once around the unit circle, one falls back to the starting point ${\displaystyle z=1+j0}$. From there, one can make another turn from ${\displaystyle f_{s}}$ to ${\displaystyle 2f_{s}}$, and one more from ${\displaystyle 2f_{s}}$ to ${\displaystyle 3f_{s}}$ and so on... On each of these turns, the frequency response will be the same. In other words, the transfer function of a sampled system is periodic of period equal to the sampling frequency.

With real (as opposed to complex) signals, the transfer function is symmetric around half the sampling frequency: ${\displaystyle f=f_{s}/2}$. So the transfer function of a sampled system is usually only considered between ${\displaystyle f=0}$ and ${\displaystyle f=f_{s}/2}$.