CES 520 - WEEK 11 October 31, 2006 - Sampled Data
The Fourier series
- Any periodic signal may be decomposed into harmonic sinusoids of the proper amplitude and phase
- The Discrete Fourier Transform (DFT) generates the amplitudes of the harmonic sinusoids
- Multiplies each sine/cosine by the periodic signal and integrates over one period
- The real part is the cosine term, the imaginary part is the sine term
- The Fast Fourier Transform (FFT) is an algorithm to calculate the DFT quickly
- FFT calculation proportional to N log(N) versus N2 for the DFT
- e.g. N=216=65536: N/log(N) = 65536/16 = 4096x speed improvement
- The Fourier transform is also defined for non-periodic and non-sampled signals:
- A waveform must be both sampled and periodic to have a finite numeric solution to the Fourier transform
- Fourier transform and inverse Fourier transform are the same (except for sign of exponent of e term)
- Time/frequency and Frequency/Time dualities:
- Repetition:
- Periodic <==> Sampled
- Non-periodic <==> Continuous
- Wide <==> Narrow
- Position offset <==> Change in phase
- Even symmetry <==> Real
- Odd symmetry <==> Imaginary
- Assymetrical <==> Complex
Digital signals
- Block diagram of a typical digital system
- May have analog input only, analog output only, or both
- Output sample rate may differ from input sample rate in a multirate system.
- Decimation: output sample rate = (1/N) * input sample rate
- Interpolation: output sample rate = N * input sample rate
- Resampling: input and output sample rates are not harmonically related
- A "digital" signal implies digitization in amplitude as well as time.
- Digitization in amplitude (quantization)
- Quantization effects
- Broadband quantization noise if the analog signal is "noise like", i.e. not discrete frequency(s)
- If the analog signal is sinusoidal, quantization "noise" will be discrete frequencies
- S/N ratio is roughly 6 dB per bit of resolution
- Practical ADCs are usually worse. Example: LTC2203 81.6 dB SNR, but 6*16 bit = 96 dB
- Digitization in time (sampling)
- Sampling in the time domain causes periodicity in the frequency domain
- The spectrum of the analog signal is repeated at the sample rate
- Nyquist frequency = sample frequency / 2
- Aliasing is the overlap of the frequency spectrum if the sample rate is too low
- Nyquist criterion:
- The analog signal must be band-limited to less than the Nyquist frequency to avoid aliasing.
- Sampling theorem
- If Nyquist criterion is met, the sampled signal can be perfectly reconstructed
- This ignores the effect of amplitude quantization (digitization).
- Sampled signal must be filtered (frequency domain) = interpolated (time domain)
- The ideal reconstruction filter is a rectangle function in the frequency domain.
- Cut-off frequency = Nyquist frequency = sample rate / 2
- The ideal reconstruction filter is a sinc function in the time domain:
- sinc(t) = sin(Pi*t)/(Pi*t)
- Can be viewed as filtering out the aliased frequencies or as interpolating between sample points
- Digital filters
- An infinitely-narrow impulse makes a good test signal because the spectrum is flat.
- The Fourier transform of the filter inpulse response is the filter's frequency spectrum.
- A Finite Impulse Response (FIR) filter's coefficients equal the impulse response.
- Linear system: filter output is the summation of the impulse response x input samples
- An FIR filter is a convolution engine.
- An Infinite Impulse Response filter has feedback
- More closely resembles an analog filter.
- Requires fewer multipliers but wider bit width.
- Not linear-phase. Group delay is not flat.
- Harder to design.
- Design of FIR filter coefficients
- Use your favorite filter design program
- Use the DFT method
- Specify desired response in the frequency domain.
- Generate time-domain coefficients with an inverse DFT
- Apply a window
- Do DFT on resulting impulse response to see if it meets frequency-domain requirements
- Change frequency response and iterate until requirements are met
- A so-called digital system needs two analog filters:
- Input low-pass filter to make sure input signal meets the Nyquist criterion
- Output low-pass filter to eliminate the repeated spectrum near the sampling frequency and harmonics
Analog interfacing
- D/A converters
- Pulse-width modulator
- Timer(s) control the period and duty factor (percent ON time).
- A low-pass filter integrates the pulses to give a smooth waveform.
- Good linearity but poor gain accuracy.
- Sigma delta modulator
- A "one-bit" DAC
- Pseudo-random sequence puts most energy at high frequencies where it can be filtered easily.
- Used in CD players.
- R-2R ladder
- Resolution vs sample rate
- Higher sample rate spreads quantization noise over broader bandwidth. Less noise per Hz.
- A/D converters
- Flash converter
- Fastest ADC type
- Low resolution, typically 6 or 8 bits
- Used for video
- Integrating
- Slow but excellent linearity
- Dual-slope type is more accurate - counts time to reset ramp using calibrated reference
- Used in DC voltmeters
- Sigma-delta converter
- Analagous to sigma-delta DAC
- The average value of the 1-bit output is proportional to the analog voltage.
- Successive approximation
- Most common type
- Good accuracy and speed
Assignments:
- Read Embedded Systems Design, Chapter 5, pp 141-156.