# undershoot

Undershoot metrics of bilevel waveform transitions

## Syntax

## Description

`[___] = undershoot(___,`

specifies additional options using one or more name-value arguments.`Name,Value`

)

`undershoot(___)`

plots the bilevel waveform and marks the
location of the undershoot of each transition. The function also plots the lower and upper
reference-level instants and associated reference levels and the state levels and associated
lower- and upper-state boundaries.

## Examples

### Undershoot Percentage in Posttransition Aberration Region

Determine the maximum percent undershoot relative to the high-state level in a 2.3 V clock waveform.

Load the 2.3 V clock data. Determine the maximum percent undershoot of the transition. Determine also the level and sample instant of the undershoot. In this example, the maximum undershoot in the posttransition region occurs near index 23.

load('transitionex.mat','x') [uu,lv,nst] = undershoot(x)

uu = 4.5012

lv = 2.1826

nst = 23

Plot the waveform. Annotate the overshoot and the corresponding sample instant.

undershoot(x); ax = gca; ax.XTick = sort([ax.XTick nst]);

### Undershoot Percentage, Levels, and Time Instant in Posttransition Aberration Region

Determine the maximum percent undershoot relative to the high-state level, the level of the undershoot, and the sample instant in a 2.3 V clock waveform.

Load the 2.3 V clock data with sampling instants. The clock data are sampled at 4 MHz.

load('transitionex.mat','x','t')

Determine the maximum percent undershoot, the level of the undershoot in volts, and the time instant where the maximum undershoot occurs. Plot the result.

[us,uslev,usinst] = undershoot(x,t)

us = 4.5012

uslev = 2.1826

usinst = 5.5000e-06

undershoot(x,t);

### Undershoot Percentage, Levels, and Time Instant in Pretransition Aberration Region

Determine the maximum percent undershoot relative to the low-state level, the level of the undershoot, and the sample instant in a 2.3 V clock waveform. Specify the `'Region'`

as `'Preshoot'`

to output pretransition metrics.

Load the 2.3 V clock data with sampling instants. The clock data are sampled at 4 MHz.

load('transitionex.mat','x','t')

Determine the maximum percent undershoot, the level of the undershoot in volts, and the sampling instant where the maximum undershoot occurs. Plot the result.

[us,uslev,usinst] = undershoot(x,t,'Region','Preshoot')

us = 6.1798

uslev = -0.1500

usinst = 5.0000e-06

undershoot(x,t,'Region','Preshoot');

## Input Arguments

`x`

— Bilevel waveform

real-valued vector

Bilevel waveform, specified as a real-valued row or column vector. The sample instants in
`X`

correspond to the vector indices. The first sample instant in
`x`

corresponds to t = 0.

`fs`

— Sample rate

real positive scalar

Sample rate in hertz, specified as a real positive scalar. The sample rate determines the
sample instants corresponding to the elements in `x`

.

`t`

— Sample instants

vector

Sample instants, specified as a vector. The length of `t`

must equal
the length of the input bilevel waveform `x`

.

### Name-Value Arguments

Specify optional pairs of arguments as
`Name1=Value1,...,NameN=ValueN`

, where `Name`

is
the argument name and `Value`

is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.

*
Before R2021a, use commas to separate each name and value, and enclose*
`Name`

*in quotes.*

**Example: **`'Tolerance',5`

computes the undershoot with a 5% tolerance
region.

`PercentReferenceLevels`

— Reference levels

`[10 90]`

(default) | 1-by-2 real-valued vector

Reference levels as a percentage of the waveform amplitude, specified as a 1-by-2 real-valued vector. The function defines the lower-state level to be 0 percent and the upper-state level to be 100 percent. The first element corresponds to the lower percent reference level and the second element corresponds to the upper percent reference level.

`Region`

— Aberration region

`'Postshoot'`

(default) | `'Preshoot'`

Aberration region over which to compute the undershoot, specified as
`'Preshoot'`

or `'Postshoot'`

. If you specify
`'Preshoot'`

, the function defines the end of the pretransition aberration
region as the last instant when the signal exits the first state. If you specify
`'Postshoot'`

, the function defines the start of the posttransition
aberration region as the instant when the signal enters the second state. By default, the
function computes undershoots for posttransition aberration regions.

`SeekFactor`

— Aberration region duration

`3`

(default) | real-valued scalar

Aberration region duration, specified as a real-valued scalar. The function computes the undershoot over the specified duration for each transition as a multiple of the corresponding transition duration. If the edge of the waveform is reached or a complete intervening transition is detected before the aberration region duration elapses, the duration is truncated to the edge of the waveform or the start of the intervening transition.

`StateLevels`

— Low- and high-state levels

1-by-2 real-valued vector

Low- and high-state levels, specified as a 1-by-2 real-valued vector. The first element corresponds to the low-state level and the second element corresponds to the high-state level of the input waveform.

`Tolerance`

— Tolerance level

`2`

(default) | real-valued scalar

Tolerance level, specified as a real-valued scalar. The function expresses tolerance as a percentage of the difference between the upper- and lower-state levels. The initial and final levels of each transition must be within the respective state levels.

## Output Arguments

`us`

— Undershoots

vector

Undershoots expressed as a percentage of the state levels, returned as a vector. The
length of `us`

corresponds to the number of transitions detected in the
input signal. For more information, see Undershoot.

`uslev`

— Undershoot level

column vector

Undershoot level, returned as a column vector.

## More About

### State-Level Estimation

To determine the transitions, the `undershoot`

function estimates the state levels of the input bilevel waveform `x`

by a
histogram method with these steps.

Determine the minimum and maximum amplitudes of the data.

For the specified number of histogram bins, determine the bin width, which is the ratio of the amplitude range to the number of bins.

Sort the data values into the histogram bins.

Identify the lowest and highest indexed histogram bins with nonzero counts.

Divide the histogram into two subhistograms.

Compute the state levels by determining the mode or mean of the upper and lower histograms.

The function identifies all regions that cross the upper-state boundary of the low state and the lower-state boundary of the high state. The low-state and high-state boundaries are expressed as the state level plus or minus a multiple of the difference between the state levels.

### Undershoot

The function computes the undershoot percentages based on the greatest deviation from the final state level in each transition.

For a positive-going (positive-polarity) pulse, the undershoot is given by

$$100\frac{({S}_{2}-U)}{({S}_{2}-{S}_{1})}$$

where *U* is the greatest deviation below the high-state
level, *S*_{2} is the high state, and
*S*_{1} is the low state.

For a negative-going (negative-polarity) pulse, the undershoot is given by

$$100\frac{({S}_{1}-U)}{({S}_{2}-{S}_{1})}$$

This figure shows the calculation of undershoot for a positive-going transition.

The red dashed lines indicate the estimated state levels. The double-sided black arrow depicts the difference between the high- and low-state levels. The solid black line indicates the difference between the high-state level and the undershoot value.

### State-Level Tolerances

You can specify lower- and upper-state boundaries for each state level. Define the boundaries as the state level plus or minus a scalar multiple of the difference between the high state and the low state. To provide a useful tolerance region, specify the scalar as a small number such as 2/100 or 3/100. In general, the region for the low state is defined as

where is the low-state level and is the high-state level. Replace the first term in the equation with to obtain the tolerance region for the high state.

This figure shows lower and upper 5% state boundaries (tolerance regions) for a positive-polarity bilevel waveform. The thick dashed lines indicate the estimated state levels.

## References

[1] IEEE Standard 181. *IEEE ^{®} Standard on Transitions, Pulses, and Related Waveforms* (2003):
15–17.

## Extended Capabilities

### C/C++ Code Generation

Generate C and C++ code using MATLAB® Coder™.

## Version History

**Introduced in R2012a**

## 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)