Salta al contenuto
Note per Studenti Function Generators and AWG Report

Function Generators and AWG

In questa pagina 4

To test a device the test signal must be generated with known, adjustable parameters (Oscilloscope Probes and Test SignalsA passive probe is an Rp parallel Cp network in series with the oscilloscope input; it reduces the load on the circuit and attenuates the signal, and it is compensated when Ri Ci = Rp Cp; test signals (sinusoid, rectangular, triangular, modulated, sweep) are described by a few time-domain parameters read on the screen.Oscilloscope Probes and Test Signals →). The instrument is the function generator (AFG, arbitrary function generator): an oscillator with predefined waveforms and, in modern versions, the possibility of generating an arbitrary waveform (AWG, arbitrary waveform generator). Signals are then observed with the The OscilloscopeThe oscilloscope displays the joint trend of two or more quantities; its functional blocks are input channels, trigger and synchronization, time base and acquisition and display, and its input impedance, bandwidth, rise time, coupling, hold-off and probe compensation determine how faithfully a signal is shown.The Oscilloscope →; a lab experience with the generator is in Lab 2 - AC Measurements with the Signal GeneratorSecond laboratory session: indirect measurements with a photoresistor and an LM35 sensor, use of the signal generator (sine, impedance setting) and comparison of multimeter RMS readings with the RMS formula for sinusoidal and non-sinusoidal waveforms.Lab 2 - AC Measurements with the Signal Generator →.

What it generates

  • periodic waveforms: sinusoid, square, rectangular, triangular, sawtooth, pulses, noise; one sets amplitude (VppV_{pp} or VhighV_{high} and VlowV_{low}), offsetconstant additive term in the output voltage, frequency, duty cycle;
  • modulations: AM, FM, PWM; linear or logarithmic frequency sweep;
  • a sync signal at TTL levels (00-5 V5\ \mathrm V) marking a point of the signal (start of the period, end of the sweep), useful to trigger the oscilloscope;
  • an output with impedance Rout=50 ΩR_{out}=50\ \Omega: connected to a load RLR_L (for example the 1 MΩ1\ \mathrm{M\Omega} oscilloscope input, or a circuit) the real generator is an ideal voltage generator with 50 Ω50\ \Omega in series, so the load voltage is a divider VL=VGRLRL+50 Ω.V_L=V_{G}\frac{R_L}{R_L+50\ \Omega}. With RL=50 ΩR_L=50\ \Omega the load sees half of the open-circuit voltage; with RL≫50 ΩR_L\gg50\ \Omega almost all of it. The generator also has a maximum voltage (±10 V\pm10\ \mathrm V) and a maximum output power (for example 2 W2\ \mathrm W); for a constant resistive load with VmaxV_{max} across it, P=V2/RP=V^2/R, a constraint used for example to size a resistor in series with a diode.

The core of an AWG: memory, DAC and filter

The scheme of a direct digital synthesis AWG is memory (LUT) ⟶ DAC ⟶ interpolation filter ⟶ output.\text{memory (LUT)}\ \longrightarrow\ \text{DAC}\ \longrightarrow\ \text{interpolation filter}\ \longrightarrow\ \text{output}.

If at every clock the next address is read and at the end the pointer returns to the first location, the output is a periodic waveform with period 2MTs2^MT_s: to generate a sinusoid the memory is filled with 2M2^M samples of a sinusoid. A whole number of periods must be stored, otherwise the passage from the last to the first location creates a discontinuity (and unwanted spectral lines). If KK periods are stored in 2M2^M samples, the output frequency is K Fs/2MK\,F_s/2^M: with 2M=10242^M=1024, K=4K=4, Fs=100 MS/sF_s=100\ \mathrm{MS/s} one gets 390.6 kHz390.6\ \mathrm{kHz}.

Registers PIR, PR and AR: variable-frequency synthesis

Changing the frequency by adjusting FsF_s would be inconvenient, so a phase accumulator is used:

  • PIR (phase increment register): number added at every clock;
  • PR (phase register): LL-bit register (L>ML>M) that at every clock does PR←PR+PIRPR\leftarrow PR+PIR (modulo 2L2^L): it represents the phase as a fraction of 2L2^L;
  • AR (address register): the MM most significant bits of PR, used as memory address.

With PIR=1PIR=1 the address changes every 2L−M2^{L-M} clocks; with larger PIRPIR addresses are skipped faster. On average each LUT sample lasts Ts,eq=2L−MPIR Ts(equivalent sampling period),Fs,eq=PIR 2M−LFs.T_{s,eq}=\frac{2^{L-M}}{PIR}\,T_s\qquad(\text{equivalent sampling period}),\qquad F_{s,eq}=PIR\,2^{M-L}F_s. The output period is that of 2M2^M samples: Tout=2MTs,eq=2LPIRTs,fout=PIR2LFs.T_{out}=2^MT_{s,eq}=\frac{2^L}{PIR}T_s,\qquad\boxed{f_{out}=\frac{PIR}{2^L}F_s.} The frequency resolution (PIR=1PIR=1) is Fs/2LF_s/2^L: with Fs=100 MS/sF_s=100\ \mathrm{MS/s} and L=32L=32 it is 0.023 Hz0.023\ \mathrm{Hz}.

Example. Fs=100 MS/sF_s=100\ \mathrm{MS/s}, L=32L=32, M=10M=10 (1024 samples), desired frequency 1 kHz1\ \mathrm{kHz}: PIR=103⋅232108=42 949.67PIR=\frac{10^3\cdot2^{32}}{10^8}=42\,949.67, rounded to 42 95042\,950; the real frequency is 42950232⋅108=1000.0076 Hz\frac{42950}{2^{32}}\cdot10^8=1000.0076\ \mathrm{Hz}. Each address lasts on average Ts,eq/Ts=222/42950=97.66T_{s,eq}/T_s=2^{22}/42950=97.66 clocks, so a period is 1024⋅97.66≈1051024\cdot97.66\approx10^5 clocks =1 ms=1\ \mathrm{ms}. Since Ts,eqT_{s,eq} is not an integer multiple of TsT_s, some samples last 9797 and others 9898 clocks: a small phase error (jitter) attenuated by the filter.

DAC parameters and non-idealities

  • static: offset error, gain error, integral and differential non-linearity (INL, DNL);
  • dynamic: settling time, glitches (spikes at transitions due to non-simultaneous switches), total harmonic distortion THD, SFDR (spurious free dynamic range).

An NN-bit DAC can be built with current generators weighted in powers of 22 driven by switches (Vout=I0R0∑bk2kV_{out}=I_0R_0\sum b_k2^k); element tolerances set the quality. Glitches and settling-time errors worsen at high frequency.

Common mistakes

  • Saying the output frequency is Fs/2MF_s/2^M when the phase accumulator is used: it depends on PIR/2LPIR/2^L.
  • Forgetting that AR are the most significant bits of PR.
  • Storing a non-integer number of periods in memory.
  • Neglecting the 50 Ω50\ \Omega output impedance: open-circuit and on a 50 Ω50\ \Omega load the voltage differs by a factor 22.
  • Omitting the reconstruction filter: the images at Fs±foutF_s\pm f_{out} remain.

Versione ripasso

Key statements and formulas

  • Function generator: sinusoid, square, triangular, pulses, noise, AM/FM/PWM, sweep, plus a TTL sync signal. Output impedance 50 Ω50\ \Omega: VL=VGRLRL+50 ΩV_L=V_G\frac{R_L}{R_L+50\ \Omega} (half the voltage on a 50 Ω50\ \Omega load).
  • AWG: LUT of 2M2^M samples of BB bits, DAC (staircase, step Vpp/2BV_{pp}/2^B), reconstruction filter that removes images at multiples of FsF_s; sinc(f/Fs)\mathrm{sinc}(f/F_s) attenuation of the useful signal.
  • Fixed memory readout: period 2MTs2^MT_s; a whole number KK of periods in memory, f=K Fs/2Mf=K\,F_s/2^M.
  • Phase accumulator: PR←PR+PIRPR\leftarrow PR+PIR modulo 2L2^L, ARAR = MM most significant bits of PR; Ts,eq=2L−MPIRTsT_{s,eq}=\frac{2^{L-M}}{PIR}T_s; fout=PIR2LFsf_{out}=\frac{PIR}{2^L}F_s; resolution Fs/2LF_s/2^L.
  • DAC: static parameters (offset, gain, INL, DNL) and dynamic ones (settling time, glitches, THD, SFDR).

Main steps of the examples

  • 2M=10242^M=1024, K=4K=4, Fs=100 MS/sF_s=100\ \mathrm{MS/s}: 390.6 kHz390.6\ \mathrm{kHz}.
  • Fs=100 MS/sF_s=100\ \mathrm{MS/s}, L=32L=32, M=10M=10, target 1 kHz1\ \mathrm{kHz}: PIR=42 949.67→42 950PIR=42\,949.67\to42\,950, real frequency 1000.0076 Hz1000.0076\ \mathrm{Hz}; each address lasts 97.6697.66 clocks on average (samples of 9797 or 9898 clocks: jitter).
  • Resolution with L=32L=32: 0.023 Hz0.023\ \mathrm{Hz}.

Typical mistakes

  • fout=Fs/2Mf_{out}=F_s/2^M with the accumulator.
  • AR taken as the least significant bits.
  • Non-integer number of periods in memory.
  • Ignoring the 50 Ω50\ \Omega output impedance.
  • No reconstruction filter.

Teoria collegata