Integral nonlinearity (INL) and differential nonlinearity (DNL) of data converters

该函数`inldnl`用于计算模数转换器(ADC)和数模转换器(DAC)的积分非线性(INL)和微分非线性(DNL)误差。它接受模拟输入/输出数据和转换器的名义模拟动态范围作为输入,可以使用端点法或最佳拟合法进行计算。文章提供了函数的用法示例,以及输入参数和输出结构的详细说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Syntax

s = inldnl(analog,digital,range,type)

s = inldnl(___,Name,Value)

Description

example

s = inldnl(analog,digital,range,type) calculates the integral nonlinearity (INL) and differential nonlinearity (DNL) errors of ADCs and DACs. The function calculates INL and DNL using the analog and digital input output data and the nominal analog dynamic range of the converter. The function can calculate INL and DNL either using the endpoint method, or the best fit method, or using both methods.

The inldnl function only analyzes converters with a finite number of bits. That means ADCs must have saturation and quantization. The function ignores any digital value pairs that contain NaN values.

s = inldnl(___,Name,Value) calculates the INL and DNL errors of ADCs and DACs using one or more name-value pair arguments in addition to the input arguments in the previous syntax. Enclose each argument name in quotes. Unspecified arguments take default values.

Note

Initial conditions and other anomalous data can cause this function to behave erratically. This function can analyze nonmonotonic converters, but it cannot handle multiple distinct occurrences of the same code in one transfer function.

Examples

collapse all

Calculate INL and DNL of DAC

This example uses:

View MATLAB Command

Load the digital input and the analog output of a DAC from MAT-files.

load 'digital.mat'
load 'analog.mat'

The nominal analog dynamic range of the DAC is [-1,1]. Turn on plotting for the output converter threshold. Calculate INL and DNL using both best fit and endpoint methods.

inldnl(a,d,[-1 1],'DAC','GenPlotData','on','INLMethod','All','DNLMethod','All')

ans = struct with fields:
                Type: 'DAC'
               NBits: 5
                 LSB: 0.0645
        MissingCodes: [0x1 double]
               Codes: [1x32 double]
    IdealCodeCenters: [1x32 double]
         CodeCenters: [1x32 double]
       CodeCenterStD: [1x32 double]
         EndpointINL: [1x32 double]
          BestFitINL: [1x32 double]
         EndpointDNL: [1x32 double]
          BestFitDNL: [1x32 double]
         BestFitPoly: [0.0652 0.1293]
         OffsetError: 0.8294
           GainError: 0.5224
       GainErrorUnit: 'LSB'
           TCNominal: [32x2 double]
          TCMeasured: [32x2 double]

Input Arguments

collapse all

analog — Analog input to or output from device
vector

  • If the device under test (DUT) is an ADC, analog input to the ADC, specified as a vector.

  • If the DUT is a DAC, analog output from the DAC, specified as a vector.

Data Types: double

digital — Digital output from or input to device
integer vector

  • If the device under test (DUT) is an ADC, digital output from the ADC, specified as a vector of integers.

  • If the DUT is a DAC, digital input to the DAC, specified as a vector with integer values.

Data Types: fi | single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

range — Nominal analog dynamic range of device
2-element vector

type — Type of device
Auto | ADC | DAC

Type of the device under test, specified as AutoADC, or DAC. The type determines whether to analyze the data as an ADC or DAC.

If The type is set to Auto and if the transfer function is discrete, the inldnl function analyzes the data as a DAC. The transfer function is considered as discrete if the analog data is less than half of the digital code width for each digital code.

If The type is set to Auto and if the transfer function is continuous, the inldnl function analyzes the data as an ADC.

Data Types: string

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: inldnl(a,d,[-1 1],'DAC', 'INLMethod', 'All', 'DNLMethod','All') calculates the INL and DNL of a DAC using both endpoint and best fit method.

'OffsetErrorUnit' — Unit of reported offset error
LSB (default) | %FS | FS | All

Unit of reported offset error, specified as LSB (least significant bit), %FS (percentage full scale), FS (full scale), or all.

Data Types: string

'GainErrorUnit' — Unit of reported gain error
LSB (default) | %FS | FS | All

Unit of reported gain error, specified as LSB (least significant bit), %FS (percentage full scale), FS (full scale), or all.

Data Types: string

'GenPlotData' — Send output data vectors to output data structure
off (default) | on

Send the output data vectors of the inldnl function to the output data structure s, specified as off or on. If GenPlotData is set to on, the output data structure contains the output data vectors. The output data vectors can then be picked up by the DAC DC measurementDAC TestbenchADC DC Measurement, or ADC Testbench blocks to plot the DC analysis results.

Data Types: string

'INLMethod' — Method to calculate INL
Endpoint (default) | BestFit | All

Method to calculate INL, specified as EndpointBestFit, or all.

  • If INLMethod is set to Enpoint, the inldnl function compares each threshold's position to the threshold position of an ideal converter, as determined by a line from the first code transition to the last code transition.

  • If INLMethod is set to BestFit, the inldnl function first takes the best linear fit of the ADC or DAC transfer curve. Then the function proceeds to calculate the INL using the same steps as the Enpoint method.

Data Types: string

'DNLMethod' — Method to calculate DNL
Endpoint (default) | BestFit | All

Method to calculate DNL, specified as EndpointBestFit, or all.

  • If DNLMethod is set to Enpoint, the inldnl function compares each threshold's position to the threshold position of an ideal converter, as determined by a line from the first code transition to the last code transition to find the INL. The DNL is calculated from the difference between the elements of the INL vector.

  • If DNLMethod is set to BestFit, the inldnl function first takes the best linear fit of the ADC or DAC transfer curve. Then the function proceeds to calculate the DNL using the same steps as the Enpoint method.

Data Types: string

'AbsoluteError' — Return absolute error and full scale DNL for testing
off (default) | on

Return absolute error and full scale DNL for testing, specified as on or off. Absolute error is the total uncompensated error including offset error, gain error, and nonlinearities. In simulation, to specifically test that the measurements match the impairments, absolute error can be used instead of INL. This is because absolute error describes the entire transfer curve in a single vector.

Data Types: string

Output Arguments

collapse all

s — Output device information
structure

Output information of the inldnl function, returned as a structure. The output contains information about the device under test in these fields:

NameValuesDescriptionData Types
TypeADC or DACType of the device under test (DUT)string
Nbitspositive real integerResolution of the ADC or DAC DUTdouble
LSBpositive real scalarLeast significant bit value of the DUT. LSB is the smallest level the ADC can convert or the smallest increment of the DAC output.double
MissingCodesvectorMissing codes in DUT.double
Codescolumn vectorDigital codedouble
IdealCodeCenterscolumn vectorIdeal code center of the digital codedouble
CodeCenterscolumn vectorCalculated code center of the digital codedouble
CodeCenterStDcolumn vectorStandard deviation of the code center from the ideal valuedouble
EndpointINLcolumn vectorINL using Endpoint methoddouble
BestFitINLcolumn vectorINL using BestFit methoddouble
EndPointDNLcolumn vectorDNL using Endpoint methoddouble
BestFitDNLcolumn vectorDNL using BestFit methoddouble
BestFitPolyvectorPolynomial describing the best fit using standard curve-fitting technique.double
OffsetErrorreal scalarOffset error of DUTdouble
GainErrorreal scalarGain error of DUTdouble
OffsetErrorUnitLSB%FS, or FSUnit of reported offset errorstring
GainErrorUnitLSB%FS, or FSUnit of reported gain errorstring
TCNominalvectorNominal transfer curve of the DUTdouble
TCMeasuredvectorMeasured transfer curve of the DUTdouble

If you do not assign an output variable, the inldnl function also plots the transfer function of the device under test in the active figure.

Data Types: struct

More About

collapse all

Offset Error

Offset error represents the offset of the DAC transfer function curve from it ideal value at a single point. For more information, see Measuring Offset and Gain Errors in ADC.

Gain Error

Gain error represents the deviation of the slope of the DAC transfer function curve from its ideal value. For more information, see Measuring Offset and Gain Errors in ADC.

INL Error

Integral nonlinearity (INL) error, also termed as relative accuracy, is the maximum deviation of the measured transfer function from a straight line. The straight line can either be a best fit using standard curve-fitting technique, or be drawn between the endpoints of the actual transfer function after gain adjustment.

The best fit method gives a better prediction of distortion in AC applications, and a lower value of linearity error. The endpoint method is mostly used in the measurement applications of data converters, since the error budget depends on actual deviation from the ideal transfer function.

DNL Error

Differential nonlinearity (DNL) is the deviation from the ideal difference (1 LSB) between analog input levels that trigger any two successive digital output levels. The DNL error is the maximum value of DNL found at any transition.

See Also

ADC DC Measurement | Flash ADC | SAR ADC

Topics

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值