Discrete-time signals
A 7 kHz sinusoid sampled at 8 kHz gives exactly the same samples as a 1 kHz one. In discrete time, frequency only makes sense between zero and half the sampling frequency.
01From signal to sequence
When a converter samples a signal every \( T \) seconds, what is left is a sequence of numbers \( x[n] = x(nT) \), defined only for integer \( n \). What happens between samples is lost, and by the sampling theorem that does not matter if the signal had no frequencies above \( f_s/2 \). All digital processing works on sequences, and its tools are the same as those of circuits, in discrete form: convolution, difference equations and the Z transform in place of the Laplace transform. The presentation of the two kinds of signal is in continuous-time and discrete-time signals.
02Frequency in discrete time
A sampled sinusoid is \( x[n] = \cos(\Omega n) \), with \( \Omega = 2\pi f / f_s \) the normalized frequency in radians per sample. Two properties distinguish it from the continuous one:
- It is periodic in Ω with period 2π. \( \cos((\Omega + 2\pi) n) = \cos(\Omega n) \) for every integer \( n \): the frequencies \( \Omega \) and \( \Omega + 2\pi \) are indistinguishable. It is aliasing seen from the samples. Only the interval from 0 to π makes sense, which corresponds to 0 up to \( f_s/2 \).
- It is not always periodic in n. It is only so if \( \Omega / 2\pi \) is a rational number.
03Discrete systems
A linear time-invariant discrete system is described by its impulse response \( h[n] \), and the output is the discrete convolution \( y[n] = \sum_k h[k]\, x[n - k] \). In practice almost all of them are written as a difference equation, which says how to compute each output sample from the previous inputs and outputs:
04The Z transform and the z-plane
The Z transform turns the delay of one sample into a product by \( z^{-1} \), and the difference equation into a rational transfer function \( H(z) \). The z-plane plays the role of the s-plane, related by \( z = e^{sT} \):
| In the s-plane | In the z-plane |
|---|---|
| Imaginary axis \( j\omega \) | Unit circle \( |z| = 1 \) |
| Left half-plane (stable) | Inside the unit circle |
| Pole at \( -\sigma \pm j\omega \) | Pole at \( r e^{\pm j\Omega} \), with \( r = e^{-\sigma T} \) and \( \Omega = \omega T \) |
The frequency response is \( H(z) \) evaluated on the circle, \( z = e^{j\Omega} \). A pole near the circle produces a peak at that frequency; a zero on it, a null.
The system \( y[n] = x[n] + 2r\cos\Omega_0\, y[n-1] - r^2\, y[n-2] \) has two poles at \( r e^{\pm j\Omega_0} \). On the left, the impulse response computed sample by sample; on the right, the poles in the z-plane; below, the magnitude of the frequency response from 0 to π.
05The discrete Fourier transform
To compute the spectrum of a finite-length sequence on a computer, the DFT is used, which gives \( N \) values of the frequency response equally spaced around the unit circle. The FFT is an algorithm that computes it with \( N \log_2 N \) operations instead of \( N^2 \): for 4096 points, about 50,000 instead of 16 million. It is the tool used by the labs on converters to measure the signal-to-noise ratio.
06In the lab
Program the resonator from the lab on a microcontroller, excite it with an impulse and send the output to a DAC. Measure the oscillation frequency with the oscilloscope.
Sample sinusoids of frequencies \( f \) and \( f_s - f \) with an ADC and show that they give the same sequence.
Compute the FFT of 1024 samples of a composite signal and locate its components in normalized frequency and in hertz.
07Common mistakes
- Confusing normalized frequency with analog frequency. Ω = π corresponds to \( f_s/2 \), not to 1 Hz.
- Forgetting that feedback can make the system unstable. A single pole outside the unit circle is enough.
- Expecting every sampled sinusoid to be periodic. Only if Ω/2π is rational.
- Taking the DFT as the continuous spectrum. It is samples of it, with a resolution of \( f_s/N \).
08Self-assessment
What normalized frequency does a 1 kHz sinusoid sampled at 8 kHz have?
\( \Omega = 2\pi/8 = \pi/4 \) radians per sample.
Is a system with poles at 0.9 e±j0.5 stable?
Yes: they are inside the unit circle.
Is y = 0.5x[n] + 0.5x[n−1] FIR or IIR?
FIR: it does not use previous outputs; its impulse response has two samples.
What frequency resolution does a 1024-point DFT give at 48 kHz?
\( 48\,000/1024 \approx 46.9 \) Hz.
09Further reading
- Alan V. Oppenheim and Ronald W. Schafer. Discrete-Time Signal Processing. 3rd ed., Pearson, 2010. The reference on discrete signal processing: sequences, the Z transform, the DFT and filters.
- John G. Proakis and Dimitris G. Manolakis. Digital Signal Processing. 4th ed., Pearson, 2007 (Spanish edition, “Tratamiento digital de señales”). The course text, with many examples.
- Steven W. Smith. The Scientist and Engineer's Guide to Digital Signal Processing. California Technical Publishing, 1997. A practical and intuitive introduction, freely available online.