The Mathematics of Signal Processing | The z-transform, discrete signals, and more
Source: The Mathematics of Signal Processing | The z-transform, discrete signals, and more, Zach Star, 29:47, uploaded 2019-10-24, category Mathematics, playlist index 1160.
Zach Star opens with two audio signals: his voice and a much louder high-pitched tone. Adding them is easy. Recovering the voice requires a way to describe which frequencies make up the mixture, then a way to alter those frequencies without editing every sample by hand. The video compresses a course in discrete-time signals into half an hour, moving from rational functions and pole-zero plots through moving averages, the unit circle, the z-transform, and digital filter design.
Zeros, poles, and distances
The first step looks like ordinary algebra. For , the zeros sit at and . At any chosen value of , each factor gives the distance from to one of those zeros. Multiplying the distances gives the height of the graph. At , the distances are and , so the product is . As the point moves through a zero, one distance becomes zero and the whole product follows it to zero. The sign changes after the crossing because one distance becomes negative.
Dividing by adds a pole at the origin:
The same distance calculation still gives the numerator. The denominator now divides the result by the distance to the pole. At , the output is . Moving towards a zero pulls the output towards zero. Moving towards the pole makes the denominator shrink and sends the output towards an asymptote. The pole-zero plot turns the graph into a geometric rule: zeros suppress the output near their locations, whilst poles increase it.
This picture will soon move from the real number line to the complex plane. The distances retain their meaning there, which gives a visual way to predict how a filter responds to different frequencies.
A moving average and the first filter
Real signals often carry short variations that obscure a broader trend. The video uses stock prices as an example, then applies the same idea to a cosine curve. A moving average takes consecutive samples, averages their values, and slides through the signal. Brief rises and drops lose influence because each output combines several nearby inputs.
For the first example, the cosine is sampled at intervals of and two neighbouring samples are averaged. Zach Star names the input samples and the averaged output :
The first averages are , , , , , and . Connecting the discrete output samples gives another sinusoid with the same frequency and an amplitude of . The video pauses over an important qualification. Several continuous curves could pass through the same samples, including a square wave, yet the moving average of a single sinusoid remains a single sinusoid. The output keeps the frequency and changes the amplitude.
Changing the sampling interval changes that amplitude. With an interval of , the two-point average has amplitude . With an interval of , neighbouring samples cancel and the amplitude falls to zero. The moving average therefore treats frequencies differently. That frequency-dependent behaviour is what makes it a filter.
The unit circle and the z-transform
The video places those sampling intervals on a unit circle. The angles , , and mark points around the circle. The amplitude of the two-point average can be read from the distance between the chosen point and the zero at . For a point at , that distance is , and twice the output amplitude has the same value. At , the distance is . At , the chosen point lands on the zero and the output disappears.
The distance calculation becomes a complex expression when the moving point is called rather than . The zero at contributes . A pole at the origin contributes a factor of in the denominator. Every point on the unit circle has distance from the origin, so that pole leaves the amplitude unchanged while the point moves around this particular circle. The moving-average relation can then be written as:
The video switches from this expression in to the sample equation by applying the z-transform. A factor of becomes a one-sample delay:
becomes
The transform links two descriptions of the same operation. The pole-zero plot shows the response at each point on the unit circle. The difference equation tells a computer which samples to add. Zach Star describes the z-transform as the discrete counterpart of the Laplace transform.
The same construction works for a four-sample moving average. Its arithmetic sums four neighbouring samples and divides by four. Reversing the sample equation into the z-domain gives a numerator with zeros at , , and , together with poles at the origin. The points and lie on the imaginary axis. At the point corresponding to , the four-sample average reaches a zero because four samples of that relative frequency cancel.
Normalized frequency and the correction
The first unit-circle demonstration quietly relies on a convenient cosine. Zach Star then corrects the setup. Moving the sampling interval had made the examples work because the sinusoid happened to line up with each new set of samples. To analyse arbitrary input frequencies, the sample interval stays fixed and the point moves around the unit circle instead. Its angle now represents the input frequency relative to the sampling rate.
At the point , four samples fit into each cycle and the two-point moving average still has amplitude . At the point corresponding to two samples per cycle, neighbouring samples cancel and the amplitude is zero. Frequencies closer to that zero receive stronger attenuation. The video calls these relative values normalized frequencies and uses them to explain why a two-point moving average acts as a low-pass filter.
This gives the opening audio example a working method. A complicated signal can be treated as a collection of sinusoidal components. A single sinusoid produces one spike in the frequency spectrum. Two sinusoids produce two spikes. Zach Star shows an Audacity spectrum of his voice, which spreads across roughly 120 to 1,000 Hz with a visible peak near 460 Hz. A 1,000 Hz tone added at higher amplitude creates a strong additional peak. The time-domain waveform looks chaotic. The spectrum shows the tone that needs to be removed.
Discrete signals and the imperfect notch
The audio waveform is continuous in the world and sampled at a constant rate for digital processing. Computers work with the samples because a continuous signal contains infinitely many possible values between any two instants. After the samples have been altered, a reconstruction can produce a new continuous signal.
Audacity makes the first filtering attempt easy. The filter removes frequencies at and around 1,000 Hz, which reveals the voice whilst leaving the rest of the spectrum in place. It also damages the result. The voice itself contains energy near 1,000 Hz, so the filter removes part of the speech and makes it sound distorted. The tone also remains in sections outside the selected range. Digital filters have a finite response, and engineering always involves a trade-off between the range being removed and the material left intact.
The pole-zero construction makes a more deliberate notch filter. Put a zero on, or close to, the unit circle at the frequency that should disappear. Put a pole on the same radial line, slightly closer to the origin, so the surrounding frequencies retain more of their amplitude. Complex zeros and poles arrive in conjugate pairs when the filter needs real coefficients. As a point sweeps around the unit circle, the ratio of its distances from the zeros and poles gives the filter’s output amplitude. The response stays near one across most frequencies and drops around the selected zero. That dip is the notch.
The numerator and denominator of the z-transform come from the zero and pole locations. The reverse transform changes the expression back into a difference equation, which supplies the arithmetic for the samples. A digital filter may therefore look arbitrary in code, with a current sample multiplied by a coefficient and earlier samples or outputs added to it. The pole-zero plot explains why that arithmetic produces the chosen frequency response.
Moving the poles and zeros changes the response. The video compares the moving average with more advanced low-pass and band-pass filters, whose behaviour comes from the same design loop. Choose locations on the complex plane, form the z-transform, and derive the sample-by-sample operation. The plot supplies a way to see the effect before writing the final code.
From one tone to a field of work
The opening mixture can now be handled in full. A continuous signal is sampled. The filter applies its difference equation across the samples. The reconstructed result carries the desired frequency components with the notch near 1,000 Hz reduced. The method applies to image processing, radar and sonar, speech recognition, music, financial data, and mobile-phone transmissions because each domain produces signals that can be represented and processed as samples.
Zach Star places this material inside courses called Discrete-Time Signals and Systems or Digital Signal Processing. At his school, electrical engineering students had to take the course. Computer engineering students took a continuous-time signals prerequisite, and some chose digital signal processing as an elective. Other universities organise the material differently. The combination of mathematics and programming is the source’s reason to look at the subject as a possible course or job area.
Limits
The video describes itself as an overview and says that it simplifies the mathematics to fit under thirty minutes. Its graphs make the relation between distances, the unit circle, and filter response easy to see, while the captions and description provide no underlying papers or textbooks for the numerical examples. The frequency ranges and spectrum readings above belong to the demonstrations shown in the video. They are useful evidence of what the video presents, rather than independent measurements of Zach Star’s voice or of the filters in general.
The description links the Micromodeler pole-zero plot and digital filter modeller as the tool used in the video. The sponsor segment and channel links are omitted here because they do not carry the signal-processing argument.
Further reading / references
- Micromodeler DSP, the pole-zero plot and digital filter modeller linked in the video description.