Signal Generation & Digitizer – Project Answers
Question 1: Input Waveform Design for Hysteresis Test
Test Overview
The error amplifier has an internal reference of 0.8 V. The hysteresis test involves two sweeps:
• Sweep input from low → high: find switching point Vp (output goes HIGH→LOW or
LOW→HIGH)
• Sweep input from high → low: find switching point Vn
• Hysteresis = Vp – Vn (must satisfy 100 mV ≤ Hysteresis ≤ 200 mV)
Designed Waveform
The input waveform is a piecewise-linear (PWL) signal that:
• Starts at 0 V
• Ramps UP from 0 V to (Vref + margin) = 0.8 + 0.3 = 1.1 V → captures Vp during
upward sweep
• Ramps DOWN from 1.1 V to (Vref − margin) = 0.8 − 0.3 = 0.5 V → captures Vn during
downward sweep
• Returns from 0.5 V back to 0 V
Question 2: Python Code – Piecewise-Linear Waveform
import numpy as np
import [Link] as plt
clock_freq = 1000
dt = 1.0 / clock_freq
Vref = 0.8
margin = 0.3
t_points = [0, 1.0, 1.54, 2.0] # in seconds
v_points = [0, Vref + margin, Vref - margin, 0] # voltages
t = [Link](0, t_points[-1], dt)
v = [Link](t, t_points, v_points)
# Plot
[Link](figsize=(10, 5))
[Link](t, v, 'b-', linewidth=2, label='AWG Input Waveform')
[Link](y=Vref, color='r', linestyle='--', label=f'Vref = {Vref}V')
[Link](y=Vref + 0.1, color='g', linestyle=':', label='Vhigh = Vref + 100mV')
[Link](y=Vref - 0.1, color='orange', linestyle=':', label='Vlow = Vref -
100mV')
[Link]('Time (s)')
[Link]('Voltage (V)')
[Link]('Hysteresis Test Waveform (1kHz AWG)')
[Link]()
[Link](True)
plt.tight_layout()
[Link]()
print(f'Total samples: {len(t)}')
print(f'Waveform: {v[:5]} ...')
Question 3: Python Code – Sine Wave Generator
import numpy as np
import [Link] as plt
def generate_sine(f, R):
T = 1.0 / f # Period of one cycle
N = int(R / f) # Number of samples for one cycle
t = [Link](0, T, N, endpoint=False)
v = 1.0 * [Link](2 * [Link] * f * t) # Amplitude = 1.0V, phase = 0
return t, v
f = 1000
R = 100000
t, v = generate_sine(f, R)
[Link](figsize=(10, 4))
[Link](t * 1e3, v, 'b-', linewidth=2)
[Link]('Time (ms)')
[Link]('Amplitude (V)')
[Link](f'Sine Wave: f={f}Hz, A=1.0V, Phase=0°')
[Link](True)
plt.tight_layout()
[Link]()
Question 4: Commercial Digitizer Specification Analysis
4.1 Full Specification Summary
The commercial digitizer provides four selectable voltage ranges (±3 V, ±10 V, ±30 V, −40 V…
+80 V), all with 20-bit resolution. Key specs are:
Parameter Value
Voltage Ranges ±3 V, ±10 V, ±30 V, −40…+80 V
Resolution 20 bit (10 µV to 200 µV LSB depending on range)
DC Accuracy ±(0.5–10 mV + 100 ppm of reading)
INL (typical) ±24 µV to ±1 mV depending on range
DNL (typical) ±1 ppm FSR
Ground Sense Range ±5 V
Input Impedance > 1 GΩ (typical)
Input Capacitance 165 pF (typical)
Sampling Rate 0 … 1 Msps
Analog Bandwidth (−3 dB) 250 kHz
Filters Programmable digital filter 100 Hz … 250 kHz
Waveform Capture Memory Up to 107 MByte / channel; 11–16 Bytes per sample
4.2 Anti-Aliasing Filter Specification
The specification related to the anti-aliasing filter is:
• Analog Bandwidth (typical, −3 dB): 250 kHz
• Sampling Rate: 0 … 1 Msps
Explanation: By Nyquist's theorem, the maximum signal frequency that can be correctly digitized
at a sampling rate R is R/2 (the Nyquist frequency). At the maximum rate of 1 Msps, the Nyquist
frequency is 500 kHz. The analog bandwidth of 250 kHz (−3 dB point) effectively acts as the
anti-aliasing filter it attenuates frequency components above 250 kHz before they reach the
ADC, preventing aliasing of out-of-band signals back into the digitized signal. The
programmable digital filter (100 Hz … 250 kHz) can provide additional anti-aliasing filtering
when operating at lower sampling rates.
4.3 PGA (Programmable Gain Amplifier) Specification
The specification related to the PGA in front of the ADC is:
• Voltage Ranges: ±3 V, ±10 V, ±30 V, −40 V … +80 V
• DC Accuracy: varies per range (±0.5 mV to ±10 mV + 100 ppm of reading)
• Resolution LSB: varies per range (10 µV, 25 µV, 70 µV, 200 µV)
Explanation: The PGA sits between the analog input and the ADC core. Its primary role is to
scale the input signal so it optimally fills the ADC's full-scale range. The four selectable voltage
ranges (±3 V through −40/+80 V) represent different PGA gain settings. A higher gain (small
range, e.g. ±3 V) gives better resolution (10 µV LSB) but narrows the input span. A lower gain
(large range, e.g. ±80 V) accepts larger signals but at coarser resolution (200 µV LSB). The
variation in DC accuracy across ranges also reflects the PGA's contribution to overall
measurement error.