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 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
Open the model time_metrics_measure
. The model consists of a Timing Measurement block. A period sine wave of 50e6
Hz is applied at the reference input signal. A variable time delay of 1e-11
s is applied at the test input port. The Timing Measurement block is set to measure the period, frequency, 10%-90% rise time, 90%-10% fall time, duty cycle, and the delay with respect to the test input port.
model = 'time_metrics_measure';
open_system(model)
Run the model for 100
microseconds. The results are displayed on a Display block.
Period = 0.2 microseconds
Frequency = 50 MHz
Rise time = 5.903 nanoseconds
Fall time = 5.903 nanoseconds
Duty cycle = 0.5
Delay = 10 picoseconds
Ports
Input
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
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
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
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)