dutycycle
Pulse wave filling factor.
| Library |
|
Syntax
Function call
-
d = dutycycle(x)— returns the ratio of pulse duration to pulse period for each pulse of positive polarity. The function defines all areas that intersect the upper boundary of the lower state and the lower boundary of the upper state. To determine the transitions defining each pulse, the functiondutycycleevaluates the state levelsxusing the histogram method. The boundaries of the lower and upper states are expressed as the state level plus or minus a scalar value that is a multiple of the difference between the state levels. For more information, see State-level tolerances.
-
d,initcross,finalcross,nextcross,midlev = dutycycle(___)— with any input arguments from the previous syntaxes, it also returns:-
vector
initcross, the elements of which correspond to the average intersections (moments of the average reference level) of the initial transition of each pulse with the correspondingnextcross; -
vector
finalcross, the elements of which correspond to the average intersections (moments of the average reference level) of the final transition of each pulse with the correspondingnextcross; -
vector
nextcross, the elements of which correspond to the average intersections (moments of the average reference level) of the next detected transition for each pulse; -
scalar
midlev, corresponding to the average reference level.
-
-
___ = dutycycle(___,Name,Value)— returns the ratio of the pulse duration to the pulse period with additional parameters specified by one or more arguments of the typeName,Value.
-
dutycycle(___)— displays the waveform, the location of the moments of the middle reference level, the corresponding reference levels, the state levels, and the corresponding boundaries of the lower and upper states.
Arguments
Input arguments
# x is a two— level signal
+
the real vector
Details
A two-level signal defined as a real vector.
| Типы данных |
|
#
fs —
sampling
rate
1 Hz (by default) | positive scalar
Details
The sampling rate, set as a positive scalar, expressed in Hz.
| Типы данных |
|
#
tau,prf —
pulse duration and repetition
rate
scalars
Details
Pulse duration and repetition rate, set as scalars. Express the pulse duration in seconds and the repetition rate in pulses per second. Composition tau and prf must be less than or equal to one.
| Типы данных |
|
Name-value input arguments
Specify optional argument pairs as Name,Value, where Name — the name of the argument, and Value — the appropriate value. Name-value arguments should be placed after other arguments, but the order of the pairs does not matter.
Use commas to separate the name and value, and Name put it in quotation marks.
# MidPercentReferenceLevel — the average reference level
+
50 (by default) | positive scalar
Details
The average reference level, defined as a pair separated by a comma, consisting of "MidPercentReferenceLevel" and a positive scalar, expressed as a percentage of the signal amplitude.
| Типы данных |
|
# Polarity — the polarity of the pulse
+
"positive" (by default) | "negative"
Details
The polarity of the pulse, defined as a pair separated by a comma, consisting of "Polarity" and either "positive", or "negative".
-
If specified
"positive", functiondutycycleIt searches for pulses with positive initial transitions (positive polarity). -
If specified
"negative", functiondutycycleIt searches for pulses with negative initial transitions (negative polarity).
For examples of positive and negative polarity pulses, see Pulse polarity.
| Типы данных |
|
# StateLevels — lower and upper state levels
+
the real vector
Details
The levels of the lower and upper states, specified as a pair separated by a comma, consisting of "StateLevels" and a vector of real values of size 1 on 2. The first element is the lower state level. The second element is the upper state level. If the levels of the lower and upper states are not specified, the function dutycycle evaluates the state levels based on the input signal using the histogram method.
| Типы данных |
|
# Tolerance — tolerance levels
+
2 (default) | positive scalar
Details
Tolerance levels (boundaries of the lower and upper states), set as a pair separated by a comma, consisting of "Tolerance" and a positive scalar, expressed as a percentage. For more information, see State-level tolerances.
| Типы данных |
|
# out — type of output data
+
:data (by default) | :plot
Details
Type of output data:
-
:data— the function returns data; -
:plot— the function returns a graph.
Output arguments
# d — fill factor
+
vector | scalar
Details
The fill factor returned as a vector or scalar. Elements d correspond to the ratio of the pulse duration to the repetition period for each pulse in x. d obeys the condition , because the pulse duration cannot exceed a period. Length d is equal to the number of pulse periods in x. If the arguments are specified tau and prf, d it will be a scalar.
# initcross — the moment of the average reference level of the initial transition
+
vector
Details
The moments of the average reference level of the initial transitions, returned as a vector. Elements initcross correspond to the average intersections (moments of the average reference level) of the initial transition of each pulse with the corresponding nextcross.
# finalcross — the moment of the average reference level of the final transition
+
vector
Details
The moments of the average reference level of the end transitions, returned as a vector. Elements finalcross correspond to the average intersections (moments of the average reference level) of the final transition of each pulse with the corresponding nextcross.
# nextcross — the average intersection of the next transition
+
vector
Details
The average intersection of the next transition, returned as a vector. Elements nextcross correspond to the average intersections (moments of the average reference level) of the next detected transition for each pulse.
# midlev — the average reference level
+
scalar
Details
The value of the average reference level signal returned as a scalar. midlev is a scalar, because in a two—level pulse signal, the state levels are constant.
Additional Info
Fill factor
Details
The filling coefficient of a two—level pulse is the ratio of average power to peak power.
The energy of a two-level or rectangular pulse is equal to the product of the peak power for the duration of the pulse . Devices for measuring energy in the form of a signal operate on time scales exceeding the duration of a single pulse. Therefore, the average power is usually measured.
where — the pulse period.
The ratio of average power to peak power is the fill factor.:
Pulse polarity
Details
The polarity of the pulse is determined by the direction of its initial transition.
If the initial transition of the pulse is positive, the pulse has a positive polarity. This figure shows a positive polarity pulse.:
Similarly, a positive polarity pulse (with a positive increase) has a higher end state than the initial one.
If the initial transition of the pulse is negative, the pulse has a negative polarity. This figure shows a negative polarity pulse.:
In other words, an impulse of negative polarity (with a negative increase) has an initial state higher than the final one.
State-level tolerances
Details
You can specify the boundaries of the lower and upper states for each state level. Define boundaries as the level of states plus or minus a scalar value that is a multiple of the difference between the upper and lower states. To set a useful tolerance range, specify a scalar value as a small number, for example or . In the general case, the area for the lower state, it is defined as
where — low-level condition, and — high-level status. Replace the first term in the equation with to get the tolerance area for a high-level condition.