Main Content

ADC Testbench

Measures DC and AC performance metrics of ADC output

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

  • ADC Testbench block

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.

The ADC Testbench block generates the stimulus to drive the device under test (DUT) from the Stimulus tab. The setup parameters for validating the DUT are defined in the Setup tab and the target validation metrics are defined in the Target Metric tab.

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 the ADC output, specified as a scalar.

Data Types: fixed point | single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean

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

Data Types: double

Output

expand all

Analog output stimulus signal for the ADC input, returned as a scalar.

Data Types: double

External start conversion clock for ADC, returned as a scalar. 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 for which the simulation must run to obtain meaningful results, specified as a positive real scalar in seconds.

  • To measure DC performance, 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.

  • To measure AC performance, 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 automatically set the Recommended min. simulation stop time (s) as the stop time of the Simulink® model.

Measure the differential nonlinearity (DNL) error and integral nonlinearity (INL) error using the endpoint method. This method uses the end points of the actual transfer function to measure the DNL and INL error.

Measure the differential nonlinearity (DNL) error and integral nonlinearity (INL) error using the best fit method. This method uses a standard curve fitting technique to find the best fit to measure the DNL and INL error.

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 signal to an ADC block, specified as a positive real scalar in hertz. Analog input frequency (Hz must match the input frequency to the ADC device under test.

Analog signal frequency needs to satisfy two requirements:

  • All the output codes of the ADC must be activated.

  • The Analog input frequency (Hz must not share any common multiples other than 1 with the Start conversion frequency (Hz).

To satisfy both the conditions, use the equation fanalog=JMfstart [2],

where:

fanalog is the analog signal frequency,

fstart is the start conversion frequency,

M>2Nbits·π, where Nbits is the number of bits of the ADC,

and J is an integer with no common factors with M.

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

Maximum allowed difference in the amplitude of the successive samples of the analog input signal, specified as positive real scalar in least significant bit (LSB).

Dependencies

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

Data Types: double

Setup

Click to automatically propagate setup parameters from the ADC.

Dependencies

This parameter only works when the ADC is a Flash ADC or a SAR ADC from the Mixed-Signal Blockset.

Number of physical output bits, specified as a unitless positive real integer in the range [1, 26]. 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.

Shifts quantization steps by specific value, specified as a positive real scalar in %FS, FS, or 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 least significant bit %FS, FS, or LSB.

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

[2] IEEE Std 1241-2010. "IEEE Standard for Terminology and Test Methods for Analog-to-Digital Converters," pp. 29-30, 14 January 2011.

Introduced in R2019a