Measures DC and AC performance metrics of ADC output
Mixed-Signal Blockset / ADC / Measurements & Testbenches
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.
from adc digital
— Digital signal from ADC outputDigital input signal from the ADC output, specified as a scalar.
Data Types: fixed point
| single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
| Boolean
from adc ready
— Conversion ready signal from ADC outputConversion ready signal from the ADC output, specified as a scalar. This signal indicates when the ADC conversion process is complete.
Data Types: double
to adc analog
— Analog stimulus signal for ADC inputAnalog output stimulus signal for the ADC input, returned as a scalar.
Data Types: double
to adc start
— External start conversion clock for ADCExternal start conversion clock for ADC, returned as a scalar. This signal starts the conversion process in ADC block.
Data Types: double
Measurement
— Select whether to measure DC or AC performance metricsDC
(default) | AC
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.
Recommended min. simulation stop time (s)
— Minimum time simulation must run for meaningful result2.048e-02
(default) | positive real scalarMinimum 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:
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: .
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:
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
Set as model stop time
— Automatically set recommended min. simulation stop time as model stop timeClick to automatically set the Recommended min. simulation stop time (s) as the stop time of the Simulink® model.
Endpoint
— Measure DNL, INL using endpoint methodMeasure 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.
Best fit
— Measure DNL, INL using best fit methodMeasure 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.
Plot DC analysis result
— Plot DC analysis resultsClick 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.
This parameter is only available when Measurement option is
set to DC
.
Export measurement result
— Store detailed test results to base workspaceClick to store detailed test results to a spreadsheet (XLS file) or as comma-separated values (CSV file) for further processing.
Distortion measurement type
— Type of distortion to measureHarmonic
(default) | Intermodulation
Type of distortion the ADC Testbench block is set to measure,
specified as Harmonic
or
Intermodulation
.
To enable this parameter, set Measurement option as
AC
.
Block parameter:
DistortionMeasurement |
Type: character vector |
Values:
Harmonic |
Intermodulation |
Default:
Harmonic |
Analog stimulus frequency (Hz)
— Frequency of the analog input signal to ADCFrequency of the analog input signal to an ADC block, specified as a positive real scalar in hertz. Analog stimulus frequency must match the input frequency to the ADC device under test. By default, this parameter is calculated automatically. You can deselect Set automatically to customize the value.
When the ADC Testbench is set to measure the
Harmonic
distortion, the default value of
Analog stimulus frequency is
976.563
.
When the ADC Testbench is set to measure the
Intermodulation
distortion, the default value of
Analog stimulus frequency is
[878.907,1074.22]
.
Analog stimulus frequency needs to satisfy two requirements:
All the output codes of the ADC must be activated.
The Analog stimulus frequency must not share any common multiples other than 1 with the Start conversion frequency.
To satisfy both the conditions, use the equation [2],
where:
fanalog is the analog signal frequency,
fstart is the start conversion frequency,
, where Nbits is the number of bits of the ADC,
and J is an integer with no common factors with M.
To enable this parameter, set Measurement option as
AC
.
Block parameter:
InputFrequency |
Type: character vector |
Values: positive real scalar | positive real valued vector |
Default:
976.563 |
Resolution bandwidth (Hz)
— Resolution bandwidthResolution bandwidth, specified as a positive real scalar in hertz. This parameter defines the smallest positive frequency that can be resolved. By default, this parameter is calculated automatically. You can deselect Set automatically to customize the value.
When the ADC AC Measurement is set to measure the
Harmonic
distortion, the default value of
Resolution bandwidth (Hz) is
97.6563
.
When the ADC AC Measurement is set to measure the
Intermodulation
distortion, the default value of
Resolution bandwidth (Hz) is
87.8907
.
To enable this parameter, set Measurement option as
AC
.
Block parameter:
RBW |
Type: character vector |
Values: positive real scalar |
Default:
97.6563 |
Start conversion frequency (Hz)
— Frequency of the start conversion clock of the ADC1e6
(default) | positive real scalarFrequency 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.
Block parameter:
StartFreq |
Type: character vector |
Values: positive real scalar |
Default:
1e6 |
Data Types: double
RMS aperture jitter (s)
— RMS aperture jitter to be added by the start conversion clock40e-12
(default) | positive real scalarRMS aperture jitter to be added by the start conversion clock, specified as a positive real scalar in seconds.
Block parameter:
RMSJitt |
Type: character vector |
Values: positive real scalar |
Default:
40e-12 |
Data Types: double
Error tolerance (LSB)
— Maximum difference between successive samples of analog signal0.1
(default) | positive scalar in the range (0, 1
]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).
To enable this parameter, set Measurement option as
DC
.
Data Types: double
Number of bits
— Number of physical output bits10
(default) | positive real integer in the range [1, 26]
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.
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
Input range (V)
— ADC dynamic range[-1 1]
(default) | 2-element row vectorADC dynamic range, specified as a 2-element row vector in volts.
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
Hold off time (s)
— Delay before measurement analysis0
(default) | nonnegative real scalarDelays measurement analysis to avoid corruption by transients, specified as a nonnegative real scalar in seconds.
Block parameter:
HoldOffTime |
Type: character vector |
Values: nonnegative real scalar |
Default:
0 |
Data Types: double
Show spectrum analyzer during simulation
— Displays spectrum analyzer during simulationDisplays spectrum analyzer during simulation. By default, this option is deselected.
This parameter is only available when Measurement option is
set to AC
.
Enable increased buffer size
— Enable increased buffer sizeSelect to enable increased buffer size during simulation. By default, this option is deselected.
Buffer size
— Number of samples of the input buffering available during simulation5
(default) | positive integer scalarNumber 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.
This parameter is only available when Enable increased buffer size option is selected in the Configuration tab.
Block parameter:
NBuffer |
Type: character vector |
Values: positive integer scalar |
Default:
5 |
Data Types: double
Autofill target metric
— Automatically propagate target metrics from ADCOffset error
— Shifts quantization steps by specific value1.5 LSB
(default) | real scalarShifts quantization steps by specific value, specified as a positive real scalar in %FS, FS, or LSB.
To enable this parameter, set Measurement option to
DC
.
Block parameter:
TargetOffsetError |
Type: character vector |
Values: real scalar |
Default:
1.5 LSB |
Data Types: double
Gain error
— Error on the slope of ADC transfer curve1 LSB
(default) | real scalarError 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.
To enable this parameter, set Measurement option to
DC
.
Block parameter:
TargetGainError |
Type: character vector |
Values: real scalar |
Default:
1 LSB |
Data Types: double
[2] IEEE Std 1241-2010. "IEEE Standard for Terminology and Test Methods for Analog-to-Digital Converters," pp. 29-30, 14 January 2011.
ADC AC Measurement | ADC DC Measurement | Flash ADC | SAR ADC
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.