Main Content

timeDomainSignal2DutyCycle

Measure duty cycle of time-domain signal

Since R2020b

Description

example

DutyCycle = timeDomainSignal2DutyCycle(Tin,Vin) returns the duty cycle of the time-domain input signal represented by [Tin, Vin].

Examples

collapse all

Determine the duty cycle of a time-domain signal.

load tin.mat;
load xin.mat;
dutycycle = timeDomainSignal2DutyCycle(t,x)
dutycycle = 4×1

    0.5000
    0.5000
    0.5000
    0.5000

Input Arguments

collapse all

Sample time points in the signal of interest, specified as a vector of the same length as Vin.

Data Types: double

Signal values at the sample time points defined in Tin, specified as a vector of the same length as Tin.

Data Types: double

Output Arguments

collapse all

Ratio of the positive pulse width to pulse period, returned as a vector of the same length as the number of pulse periods present in the signal. Since pulse width cannot exceed pulse period, DutyCycle has a range of (0,1).

Version History

Introduced in R2020b