# :MTESt:MARGin:AUTO:HRATio

:MTESt Margin Commands

- :MTESt:MARGin:AUTO:HITS
- :MTESt:MARGin:AUTO:HRATio
- :MTESt:MARGin:AUTO:METHod
- :MTESt:MARGin:METHod
- :MTESt:MARGin:PERCent
- :MTESt:MARGin:STATe

## Command Syntax

    :MTEStN:MARGin:AUTO:HRATio <ratio>

<ratio> is a double.

Where N identifies a specific mask and must be a value from 1 to 16 {1:16}. For example, `:MTESt2` selects mask 2.

## Description

Automatically sizes the mask margin to be based on the target hit ratio. Typically this is 5.0E−5 (allows 1 violation in every 20000 samples). In the displayed Mask Test results table, a hit ratio confidence value (+/-) is displayed above the Hit Ratio. This value shows the confidence that the actual hit ratio of the signal is less than or equal to the target hit ratio. Use Hit Ratio based mask testing with measurement limit testing (based on percent uncertainty) to reduce test times while increasing test repeatability. This is especially important in testing high-volume optical transceivers. Automatic margin sizing can also be based on a hit count as determined by the `:MTESt:MARGin:AUTO:METHod` command.

Use the following procedure to set up your testing.

1. Load a mask.
2. Select automatic margins based on hit ratio.
3. Configure a measurement limit test based on margin uncertainty for the given hit ratio. Set the Lower Limit and Upper Limit to set the percentage range of margin uncertainty that you want to stop the mask margin testing. For example, ±3%. When the uncertainty drops within this limit, the testing stops.
4. Stop data acquisition, clear the display, and run the test.

## Example Command Sequence

    :MTESt2:LOAD:FNAMe "C:\Program Files (x86)\Keysight\Infiniium\Demo\Masks\SONET_SDH\009.95328 - STM064_OC192.mskx"
    :MTESt2:LOAD
    :MTESt2:MARGin:METHod AUTO
    :MTESt2:MARGin:AUTO:METHod HRATio
    :MTESt2:MARGin:AUTO:HRATio 5.0E-5
    :MTESt2:MARGin:STATe ON