ADC Testbench

Measures DC and AC performance metrics of ADC output

  • Library:
  • Mixed-Signal Blockset / ADC / Measurements & Testbenches

Description

The ADC Testbench block measures both DC and AC performance metrics. DC performance metrics include offset error and gain error. AC performance metrics include signal to noise ratio (SNR), signal to noise and distortion radio (SINAD), spurious free dynamic range (SFDR), effective number of bits (ENOB), noise floor, and conversion delay.

You can use the ADC Testbench block to validate the ADC architectural models provided in Mixed-Signal Blockset™, or you can validate an ADC of your own implementation.

Ports

Input

expand all

Digital input signal from ADC output, specified as a scalar or vector.

Data Types: fixed point | single | double | uint8 | uint16 | uint32

Conversion ready signal from ADC output, specified as a scalar or vector. This signal indicates when the ADC conversion process is complete.

Data Types: double

Output

expand all

Analog output stimulus signal for ADC input, specified as a scalar or vector.

Data Types: double

External start conversion clock for ADC, specified as a scalar or vector. This signal starts the conversion process in ADC block.

Data Types: double

Parameters

expand all

Select whether to measure static (DC) or dynamic (AC) performance metrics.

  • Select DC to measure offset error and gain error.

  • Select AC to measure SNR, SINAD, SFDR, ENOB, noise floor, and conversion delay.

Minimum time the simulation must run to obtain meaningful results, specified as a positive real scalar in seconds.

For DC measurement, the simulation must run so that ADC can sample each digital code 20 times, assuming a ramp input that traverses the full scale range of the ADC over the period of simulation. Based on this assumption, the analog input frequency (fanalog), generated by the ADC Testbench block for the sawtooth waveform is set as:

fanalog=StartFreq2(Nbits+1)·10

where StartFreq is the frequency of the conversion start clock and Nbits is the resolution of the ADC.

So, the Recommended min. simulation stop time (s) (T) is calculated by using the formula: T=1fanalog.

For AC measurement, the simulation must run so that the ADC can generate 6 spectral updates of the ADC output. The time to generate one spectral output based on Welch's method [1] is given by:

t=1.5·SamplingFrequencyRBW

where SamplingFrequency and RBW are the sampling frequency and resolution bandwidth of the spectrum estimator inside the ADC Testbench block.

This parameter is only reported by the testbench and is not editable.

Data Types: double

Click to plot DC analysis result for further analysis. To perform a complete DC analysis including integral nonlinearity (INL) and differential nonlinearity (DNL), use the ADC DC Measurement block.

Dependencies

This parameter is only available when Measurement option is set to DC.

Click to store detailed test results to a spreadsheet (XLS file) or as comma-separated values (CSV file) for further processing.

Stimulus

Frequency of the analog input to ADC, specified as a positive real scalar in Hz.

Dependencies

This parameter is only available when you set Measurement option as AC.

Programmatic Use

  • Use get_param(gcb,'InputFrequency') to view the current value of Analog input frequency (Hz).

  • Use set_param(gcb,'InputFrequency',value) to set Analog input frequency (Hz) to a specific value.

Data Types: double

Frequency of the start conversion clock of the ADC, specified as a positive real scalar in Hz. Start conversion frequency (Hz) must match the frequency of the start conversion clock of the ADC block.

Programmatic Use

  • Use get_param(gcb,'StartFreq') to view the current value of Start conversion frequency (Hz).

  • Use set_param(gcb,'StartFreq',value) to set Start conversion frequency (Hz) to a specific value.

Data Types: double

RMS aperture jitter to be added by the start conversion clock, specified as a positive real scalar in seconds.

Programmatic Use

  • Use get_param(gcb,'RMSJitt') to view the current value of RMS aperture jitter (s).

  • Use set_param(gcb,'RMSJitt',value) to set RMS aperture jitter (s) to a specific value.

Data Types: double

Setup

Click to automatically propagate setup parameters from ADC.

Dependencies

This parameter only works when the ADC is a Flash ADC or a SAR ADC from the Mixed-Signal Blockset. The Simulink® model must consist of only two blocks, the ADC Testbench and the ADC architecture of interest.

Number of physical output bits, specified as a unitless positive real integer. Number of bits determines the resolution of the ADC.

Programmatic Use

  • Use get_param(gcb,'NBits') to view the current Number of bits.

  • Use set_param(gcb,'NBits',value) to set Number of bits to a specific value.

Data Types: double

ADC dynamic range, specified as a 2-element row vector in volts.

Programmatic Use

  • Use get_param(gcb,'InputRange') to view the current Input range (V).

  • Use set_param(gcb,'InputRange',value) to set Input range (V) to a specific value.

Data Types: double

Delays measurement analysis to avoid corruption by transients, specified as a nonnegative real scalar in seconds.

Programmatic Use

  • Use get_param(gcb,'HoldOffTime') to view the current value of Hold off time (s).

  • Use set_param(gcb,'HoldOffTime',value) to set Hold off time (s) to a specific value.

Data Types: double

Displays spectrum analyzer during simulation. By default, this option is deselected.

Dependencies

This parameter is only available when Measurement option is set to AC.

Select to enable increased buffer size during simulation. By default, this option is deselected.

Number of samples of the input buffering available during simulation, specified as a positive integer scalar.

Selecting different simulation solver or sampling strategies can change the number of input samples needed to produce an accurate output sample. Set the Buffer size to a large enough value that the input buffer contains all the input samples required.

Dependencies

This parameter is only available when Enable increased buffer size option is selected in the Configuration tab.

Programmatic Use

  • Use get_param(gcb,'NBuffer') to view the current value of Buffer size.

  • Use set_param(gcb,'NBuffer',value) to set Buffer size to a specific value.

Data Types: double

Target Metric

Click to automatically propagate target metrics from ADC.

Dependencies

  • This parameter is only available when Measurement option is set to DC.

  • This parameter only works when the ADC is a Flash ADC or a SAR ADC from the Mixed-Signal Blockset. The Simulink model must consist of only two blocks, the ADC Testbench and the ADC architecture of interest.

Shifts quantization steps by specific value, specified as a positive real scalar in least significant bit (LSB).

Dependencies

This parameter is only available when Measurement option is set to DC.

Programmatic Use

  • Use get_param(gcb,'TargetOffsetError') to view the current value of Offset error (LSB).

  • Use set_param(gcb,'TargetOffsetError',value) to set Offset error (LSB) to a specific value.

Data Types: double

Error on the slope of the straight line interpolating ADC transfer curve, specified as a positive real scalar in LSB or %.

Dependencies

This parameter is only available when Measurement option is set to DC.

Programmatic Use

  • Use get_param(gcb,'TargetGainError') to view the current value of Gain error.

  • Use set_param(gcb,'TargetGainError',value) to set Gain error to a specific value.

Data Types: double

References

[1] Spectrum Analyzer, DSP System Toolbox, MathWorks Documentation.

Introduced in R2019a