Main Content

Timing Measurement

Measure period, frequency, duty cycle, rise time, fall time, and delay of a signal

Since R2020b

  • Timing Measuement block

Libraries:
Mixed-Signal Blockset / Utilities

Description

The Timing Measurement block measures the basic timing metrics such as period, frequency, duty cycle, rise time, fall time, and delay of a signal.

Examples

Ports

Input

expand all

Input signal whose timing metrics are being measured, specified as a scalar.

Data Types: double

Test signal against which the delay of the input signal is measured, specified as a scalar.

Dependencies

To enable this port, select Delay as a measurement option in the Selection tab.

Data Types: double

Output

expand all

Period of the input signal, returned as a scalar.

Data Types: double

Frequency of the input signal, returned as a scalar.

Dependencies

To enable this port, select Frequency as a measurement option in the Selection tab.

Data Types: double

Rise time of the input signal, returned as a scalar.

Dependencies

To enable this port, select Rise Time as a measurement option in the Selection tab.

Data Types: double

Fall time of the input signal, returned as a scalar.

Dependencies

To enable this port, select Fall time as a measurement option in the Selection tab.

Data Types: double

Duty cycle of the input signal, returned as a scalar.

Dependencies

To enable this port, select Duty Cycle as a measurement option in the Selection tab.

Data Types: double

Delay of the input signal, returned as a scalar.

Dependencies

To enable this port, select Delay as a measurement option in the Selection tab.

Data Types: double

Parameters

expand all

Selection

Select to measure the period of the input signal.

Period is defined as the time required to complete one full cycle of a periodic signal, specified in seconds.

Select to measure the frequency of the input signal.

Frequency is defined as the number of cycles completed per unit of time by a periodic signal, specified in hertz. It is the inverse of Period.

Select to measure the rise time of the input signal.

Rise time is defined as the time required by the rising edge of the signal to reach from 10% to 90% (or 20% to 80%) of its steady state value, specified in seconds.

Select to measure the fall time of the input signal.

Fall time is defined as the time required by the falling edge of the signal to go from 90% to 10% (or 80% to 20%) of its steady state value, specified in seconds.

Select to measure the duty cycle of the input signal.

Duty cycle is defined as the ratio of positive pulse width to period, specified as a fraction.

Select to measure the delay of the input signal.

Delay is defined as the time difference between the threshold crossing points between the signal of interest against a test signal, specified in seconds.

Configuration

Select to use the same reference threshold for measuring all timing metrics.

Reference threshold voltage used for measuring all timing metrics, specified as a scalar in volts.

Dependencies

To enable this parameter, select Use same reference threshold for all measurements in the Configuration tab.

Programmatic Use

  • Use get_param(gcb,'SameRefThreshold') to view the current value of Reference threshold (V).

  • Use set_param(gcb,'SameRefThreshold',value) to set Reference threshold (V) to a specific value.

Period/Frequency

Reference threshold voltage used to measure the period and/or the frequency of the signal of interest, specified as a scalar in volts.

Dependencies

To enable this parameter, deselect Use same reference threshold for all measurements in the Configuration tab and select Period and/or Frequency in the Selection tab.

Programmatic Use

  • Use get_param(gcb,'PeriodRefThreshold') to view the current value of Reference threshold (V).

  • Use set_param(gcb,'PeriodRefThreshold',value) to set Reference threshold (V) to a specific value.

Rise/Fall Time

Peak-to-peak value of the input signal, specified as a 2-element row vector in volts. The first element defines the notch value of the input signal and the second element defines the peak value. Input range (V) is used to calculate the upper and lower threshold levels to calculate the rise/fall times.

Dependencies

To enable this parameter, select Rise Time and/or Fall Time in the Selection tab.

Programmatic Use

  • Use get_param(gcb,'Range') to view the current value of Reference threshold (V).

  • Use set_param(gcb,'Range',value) to set Reference threshold (V) to a specific value.

Determines the input threshold levels to measure the rise/fall times, specified as either 80%/20% or 90%/10%.

Dependencies

To enable this parameter, select Rise Time and/or Fall Time in the Selection tab.

Programmatic Use

  • Use get_param(gcb,'MeasurementType') to view the current value of Reference threshold (V).

  • Use set_param(gcb,'MeasurementType',value) to set Reference threshold (V) to a specific value.

Duty Cycle

Reference threshold voltage used to measure the duty cycle of the signal of interest, specified as a scalar in volts.

Dependencies

To enable this parameter, deselect Use same reference threshold for all measurements in the Configuration tab and select Duty Cycle in the Selection tab.

Programmatic Use

  • Use get_param(gcb,'DcRefThreshold') to view the current value of Reference threshold (V).

  • Use set_param(gcb,'DcRefThreshold',value) to set Reference threshold (V) to a specific value.

Delay

Threshold voltage level in reference signal of interest whose delay is being measured, specified as a scalar in volts.

Dependencies

To enable this parameter, deselect Use same reference threshold for all measurements in the Configuration tab and select Delay in the Selection tab.

Programmatic Use

  • Use get_param(gcb,'DelayRefThreshold') to view the current value of Reference threshold (V).

  • Use set_param(gcb,'DelayRefThreshold',value) to set Reference threshold (V) to a specific value.

Threshold voltage level in test signal against which the delay of the reference signal is being measured, specified as a scalar in volts.

Dependencies

To enable this parameter, deselect Use same reference threshold for all measurements in the Configuration tab and select Delay in the Selection tab.

Programmatic Use

  • Use get_param(gcb,'DelayTstThreshold') to view the current value of Reference threshold (V).

  • Use set_param(gcb,'DelayTstThreshold',value) to set Reference threshold (V) to a specific value.

Version History

Introduced in R2020b