# ADC AC Measurement

Measure AC performance metrics of ADC output

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

## Description

The ADC AC Measurement block measures ADC AC performance metrics such as 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 ADC AC Measurement block to validate the ADC architectural models provided in Mixed-Signal Blockset™, or you can use an ADC of your own implementation

## Ports

### Input

`digital`

— Converted digital signal from ADC

scalar

Converted digital signal from an ADC, specified as a scalar.

**Data Types: **`fixed point`

| `single`

| `double`

| `int8`

| `int16`

| `int32`

| `uint8`

| `uint16`

| `uint32`

`ready`

— Indicates whether analog to digital conversion is complete

scalar

Indicates whether the analog to digital conversion is complete, specified as a scalar.

**Data Types: **`double`

`start`

— External conversion start clock

scalar

External conversion start clock, specified as a scalar. The analog to digital
conversion process starts at the rising edge of the signal at the
**start** port.

**Data Types: **`double`

## Parameters

`Distortion measurement type`

— Type of distortion to measure

`Harmonic`

(default) | `Intermodulation`

Type of distortion the ADC AC Measurement block is set to measure,
specified as `Harmonic`

or
`Intermodulation`

.

#### Programmatic Use

Block parameter:
`DistortionMeasurement` |

Type: character vector |

Values:
`Harmonic` |
`Intermodulation` |

Default:
`Harmonic` |

`Analog stimulus frequency (Hz)`

— Frequency of the analog input signal to ADC

positive real scalar | positive real valued vector

Frequency 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.

When the ADC AC Measurement is set to measure the

`Harmonic`

distortion, the default value of**Analog stimulus frequency**is`10000`

.When the ADC AC Measurement is set to measure the

`Intermodulation`

distortion, the default value of**Analog stimulus frequency**is`[9000,11000]`

.

**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 $${f}_{\text{analog}}=\frac{J}{M}{f}_{\text{start}}$$ [2],

where:

*f*_{analog} is the analog signal
frequency,

*f*_{start} is the start conversion
frequency,

$$M>{2}^{Nbits}\xb7\pi $$, where *Nbits* is the number of bits of the
ADC,

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

#### Programmatic Use

Block parameter:
`InputFrequency` |

Type: character vector |

Values: positive real scalar | positive real
valued vector |

Default:
`10000` |

`Resolution bandwidth (Hz)`

— Resolution bandwidth

positive real scalar

Resolution 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`1000`

.When the ADC AC Measurement is set to measure the

`Intermodulation`

distortion, the default value of**Resolution bandwidth (Hz)**is`900`

.

#### Programmatic Use

Block parameter:
`RBW` |

Type: character vector |

Values: positive real scalar |

Default:
`1000` |

`Number of bits`

— Number of physical bits in ADC

`5`

(default) | positive real integer

Number of physical bits in ADC, specified as a unitless positive real integer.
**Number of bits** must match the resolution specified in the
ADC block.

#### Programmatic Use

Block parameter:
`NBits` |

Type: character vector |

Values: positive real integer |

Default:
`5` |

`Start conversion frequency (Hz)`

— Frequency of the start conversion clock of the ADC

`10e6`

(default) | positive real scalar

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

#### Programmatic Use

Block parameter:
`Frequency` |

Type: character vector |

Values: positive real scalar |

Default:
`10e6` |

`Hold off time (s)`

— Delays measurement analysis to avoid corruption by transients

`0`

(default) | nonnegative real scalar

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

#### Programmatic Use

Block parameter:
`HoldOffTime` |

Type: character vector |

Values: nonnegative real scalar |

Default:
`0` |

`Recommended min. simulation stop time (s)`

— Minimum time simulation must run for meaningful result

`0.009`

(default) | positive real scalar

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

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=\frac{1.5\xb7SamplingFrequency}{RBW}$$

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 time

button

Click to automatically set the **Recommended min. simulation stop time
(s)** as the stop time of the Simulink^{®} model.

`Output result to base workspace`

— Store detailed test results to base workspace

off (default) | on

Store detailed test results in the base workspace for further processing at the end of simulation. By default, this option is not selected.

`Workspace variable name`

— Name of the variable that stores detailed test results

`adc_ac_out`

(default) | character string

Name of the variable that stores detailed test results, specified as a character string.

#### Dependencies

This parameter is only available when **Output result to base
workspace** is selected.

#### Programmatic Use

Block parameter:
`VariableName` |

Type: character vector |

Values: character string |

Default:
`adc_ac_out` |

`Show spectrum analyzer during simulation`

— Displays spectrum analyzer during simulation

off (default) | on

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

## More About

### SNR

Signal to noise ratio or SNR is the ratio of the RMS signal amplitude to the mean value of the root-sum-squares of all other spectral components, excluding the DC and first five harmonics.

### SINAD

Signal to noise and distortion ratio, or SINAD is the ratio of the RMS signal amplitude to the mean value of the root-sum-squares of all other spectral components and harmonics, excluding DC.

### SFDR

Spurious free dynamic range or SFDR is the ratio of the RMS signal amplitude to the RMS value of the peak spurious content, measured over the entire first Nyquist zone (DC to half of sampling frequency).

### ENOB

Effective number of bits or ENOB represents the actual resolution of an ADC after considering internal noise and errors. It is given by $$\text{ENOB}=\frac{\text{SINAD}-1.76}{6.02}$$.

## References

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

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

## Version History

**Introduced in R2019a**

## See Also

## MATLAB Command

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.

# Select a Web Site

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: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)