Timing Measurement
Measure period, frequency, duty cycle, rise time, fall time, and delay of a signal
Since R2020b
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
Measure Timing Metrics of Periodic Signal
Measure the period, frequency, rise time, fall time, and duty cycle of a periodic signal. Also measure the delay of the input signal with respect to a reference signal
Ports
Input
reference — Input signal
scalar
Input signal whose timing metrics are being measured, specified as a scalar.
Data Types: double
test — Test signal
scalar
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
period — Period of input signal
scalar
Period of the input signal, returned as a scalar.
Data Types: double
frequency — Frequency of input signal
scalar
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 — Rise time of input signal
scalar
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 — Fall time of input signal
scalar
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 — Duty cycle of input signal
scalar
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 — Delay of input signal
scalar
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
Selection
Period — Measure period of input signal
on (default) | off
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.
Frequency — Measure frequency of input signal
off (default) | on
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.
Rise Time — Measure rise time of input signal
off (default) | on
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.
Fall Time — Measure fall time of input signal
off (default) | on
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.
Duty Cycle — Measure duty cycle of input signal
off (default) | on
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.
Delay — Measure delay of input signal
off (default) | on
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
Use same reference threshold for all measurements — Use the same reference threshold for measuring all timing metrics
on (default) | off
Select to use the same reference threshold for measuring all timing metrics.
Reference threshold (V) — Reference threshold used for measuring timing metrics
0
(default) | scalar
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.
Reference threshold (V) — Reference threshold voltage used to measure period and/or frequency
0
(default) | scalar
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.
Input range (V) — Peak-to-peak value of input signal
[-1 1]
(default) | 2-element row vector
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.
Type — Input threshold levels to measure rise/fall times
80%/20%
(default) | 90%/10%
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.
Reference threshold (V) — Reference threshold voltage used to measure duty cycle
0
(default) | scalar
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.
Reference threshold (V) — Threshold voltage level in signal of interest used to measure delay
0
(default) | scalar
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.
Test threshold (V) — Threshold voltage level in test signal used to measure delay
0
(default) | scalar
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
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)