Digital Communications - Experiment DCL-1: Sampling and Quantization (ADC+DAC)

Introduction to Analog-to-Digital Conversion (ADC) and Digital-to-Analog Conversion (DAC)

  • The interface between analog and digital domains is achieved through:
    • Analog-to-Digital Converter (ADC): Converts analog signals to digital.
    • Digital-to-Analog Converter (DAC): Converts digital signals back to analog.
  • ADC Discretization Tasks:
    • Sampling: Converts continuous-time signals to discrete-time signals.
    • Quantization: Converts continuous amplitude values to discrete amplitude levels (steps).
  • Both sampling and quantization transform quasi-infinite floating-point values into integer numbers.

Lab Experiment Focus and Setup

  • This lab focuses on ADC components.
  • Wiring and setup may be pre-configured due to time constraints, allowing focus on measurements.
  • Hardware Experiment:
    • Performed using real hardware.
    • Groups of 2-4 students work on a single workbench.
    • Hardware resources are limited, necessitating some experiments in software.
  • Software Experiment (Matlab Simulink):
    • Utilized when hardware is unavailable.
    • Commonly used in industries and research.
    • Instructions:
      • Copy provided files to a work directory.
      • Set the Matlab include path.
      • Run “initdigitalcommunications.m” initialization script.
      • Run the GUI “digitalcommunicationsgui.m”.
      • Follow on-screen steps by clicking the lab exercise button.
      • Use variables defined in “initdigitalcommunications.m” instead of constant numbers (e.g., c.sampling_frequency).

Important Notes on Units

  • Frequency:
    • Be mindful of units.
    • If frequency is required in radians/second (ω\omega), use ω=2πf\omega = 2\pi f, not ff [Hz].

Sampling in Time (ADC)

  • Prepare an analog input signal using a sine wave generator.
  • Verify the output shape, frequency, and amplitude using an oscilloscope.
  • Agilent 33500B Generator:
    • Displayed amplitude is Û, where U(t)=U^cos(ωt)U(t) = \hat{U} \cdot \cos(\omega t), not VppV_{pp} (peak-to-peak).
    • Adjust output voltage to match the ADC's valid input range (Û = 2.5V for a voltage swing of -2.5V to +2.5V, totaling 5V).
    • Adjust frequency to stay within the baseband bandwidth (e.g., 1kHz, 2kHz, 3kHz).

Sample-and-Hold Block (S&H)

  • If available, connect an S&H unit to the source (input E1, output PAM1).
  • Clock setting on the S&H box should be set to 4 = external.
  • Apply a sampling clock (TTL signal, square wave) with a frequency fs=8kHz{f_s} = 8kHz.
  • Use the generator “PNG02” with a clock output of 8kHz.
  • Measure input and output shapes via oscilloscope, along with the sampling clock.
    • Determine the trigger signal and appropriate time base (____ seconds/unit  ____ seconds/total horizontally).
  • Adjust the pulse width setting (τ\tau) and observe the output (1=3s, 2=6s, 3=30s, 4=60s, 5=120s).
  • Spectrum Analysis:
    • Measure the spectrum using a spectrum analyzer or FFT function on the oscilloscope.
    • Identify the dominant input frequency and its proximity to DC.
    • Determine its frequency and adjustments needed for better FFT visualization.
  • Audio Output:
    • Listen to the S&H block’s output using headphones or active loudspeakers.
    • Use a personal audio source (CD/MP3-player, laptop, etc.) or the PC’s sound output.
Signal Frequency and Shape Variation
  • Increase the input signal frequency beyond half of the sample frequency (to 1⋅f<em>s{f<em>s} or 2⋅f</em>s{f</em>s}) and back.
    • Observe the effect on the oscilloscope and listen to the output.
  • Change the signal shape from sine wave to ramp (linear increase with time) while keeping the frequency below fs/2{f_s}/2.
    • Verify the shape and listen to the sampled output.
Real Audio Signals
  • Use a real audio signal source like music or voice from a Walkman, MP3 player, smartphone, laptop, or the lab PC.
  • Typical Bandwidth:
    • Telephony signal: As per the bandwidth diagram.
    • Music: Assume frequencies up to 20kHz.
  • Oscilloscope observation:
    • Channel A = input, Channel B = output of the S&H block.
    • Use a stationary input signal (long sound sample or A-B-repeat).
  • Power Spectrum:
    • Obtain the power spectrum of the input and output signals using a spectrum analyzer or FFT function.
    • Explain the observed effects.

Aliasing Effect and Nyquist-Shannon Criterion

  • Sampling Theorem:
    • If x(t)x(t) contains no frequencies higher than BB Hz, it is completely determined by samples spaced T=1/(2B)T = 1/(2B) seconds apart.
    • Sufficient sample rate: fs=2B{f_s} = 2B samples/second or higher.
    • Bandlimit for perfect reconstruction: Bfs/2B \le {f_s}/2.

Anti-Aliasing Filter

  • Employ a low-pass (LP=TP) filter (“Butterworth”) before the S&H circuit.
  • Adjust the cutoff frequency to attenuate the input signal to at least -40 dB (voltage) or -20 dB (power) at fs/2{f_s}/2.
  • Use the “Butterworth TP” box with filter order n=20n = 20.
  • Repeat the experiments with the active anti-aliasing filter.
  • Explain the measurement observations and auditory experiences.

Quantization (ADC)

  • Attach the quantizer (ADC) with at least 8 digital outputs and a clock, replacing the S&H unit.
  • Set the resolution to the maximum number of bits, if possible.
  • Determine the number of discrete steps in the output.
  • Bit Clock:
    • Set f<em>bit=8f</em>s{f<em>{bit}} = 8 \cdot {f</em>s}, so for f<em>s=8kHz{f<em>s} = 8kHz, f</em>bit=64kHz{f</em>{bit}} = 64kHz.
    • Provide this clock to “Bitclock_in”.
  • Word Clock:
    • Observe and verify 8kHz at the “word clock” output (not an input).
  • Clock Phases:
    • Examine the output phases of the bit clock and word clock on an oscilloscope, triggering on the word clock.
    • Identify the start of the byte, the MSB, and the LSB using a sawtooth/ramp input waveform.
    • Explain why the input and sampled signal move on the oscilloscope.

Reconstruction (DAC)

  • Connect the full-resolution ADC and DAC using a parallel cable between “digital out parallel” and “digital in parallel”.
    • When connected via parallel cable, the output “digital out seriell” has no signal.
  • Verify the polarity of the clock and sample signals; determine fs{f_s} and explain the frequency differences.
  • Use sine wave and/or sawtooth input signals (not music).
  • Ensure the DAC output resembles the ADC input; correct if necessary.

Spectrum Analysis of Discrete-Time Signals

  • Sketch the spectrum S(f)S(f) of the input cosine wave s(t)s(t) (frequency fif_i).
  • Sketch the spectrum Ss(f){S_s}(f) of the discrete-time signal s(k)s(k).

Sample-and-Hold Reconstruction

  • Verify with an oscilloscope that the DAC output has the shape of a rect(t/Tst/T_s) reconstruction (sample-and-hold).
  • Determine the spectrum O(f)O(f) of the output signal o(t)o(t).

Sin(x)/x Reconstruction

  • If available, apply a different reconstruction/interpolator function and measure the spectrum again.

Reconstruction by Low-Pass Filter

  • Use the sample-and-hold output (rect) and attach a low-pass filter (Butterworth-TP, n=20n = 20, f<em>c=4kHz{f<em>c} = 4kHz) before f</em>s{f</em>s} to reconstruct the signal.
  • Observe the output, measure the spectrum, and explain the results.

Amplitude Quantization (ADC)

Effect of Exceeding Input Voltage Range

  • Increase the input voltage beyond the ADC's tolerable range (“clipping”).
  • Observe the signal with an oscilloscope and listen to the effect.
  • Repeat with music as input.

Effect of Limited Quantization Steps

  • Limit the quantizer resolution to 3 bits by disabling LSBs (D0..D4 down, D5..D7 up).
  • Demonstrate the input-output characteristic diagram using a sawtooth waveform and the X-Y-diagram of the oscilloscope.

Probability Distribution Function (PDF)

  • Sketch or measure the PDF of the input signal amplitude for:
    • Sawtooth
    • Sine wave
    • Gaussian noise
  • Determine if the oscilloscope can assist in calculating the PDF or histogram.

PDF of Quantization Noise Amplitude

  • Describe the typical quantization error signal in the time domain and measure it.
  • Determine the maximum voltage and its value in dBmV.
  • Explain the PDF distribution of its magnitude.
  • Calculate the noise power level in mW and dBm for the 8-bit resolution ADC, assuming R=1ΩR = 1\Omega.

Spectral Distribution of Quantization Noise

  • Sketch the spectrum of the quantization noise.
  • Measure the spectrum.

Oversampling and Digital Low-Pass Filtering

  • Examine what happens when the sampling frequency is doubled (from f<em>s{f<em>s} to 2f</em>s{f</em>s}).
  • Determine if the SNR changes.
  • Low-pass filter the discrete signal s(k)s(k) to a cut-off frequency of 2fs/4{f_s}/4 and analyze how the SNR changes and explain why.

Measuring Distortion and Signal-to-Noise Ratio (SNR)

  • Design a circuit to measure the SNR of the quantized signal.
  • Identify appropriate tools for this task.
  • Supply a sine wave input of maximum tolerable amplitude.
  • Measure how the DAC output changes with different quantization steps (1 to 8 bits).
  • Verify measurements against the theoretical curve.
  • Use the “Klirrfaktor-Analyser” and matched band-pass/band-stop filters.
  • Note that the 0dB output may provide a -40dB (amplitude 1/100) version of the distortion.