Engee documentation

pulsesep

Separation of two-level impulses.

Library

EngeeDSP

Syntax

Function call

  • S = pulsesep(x) — returns the difference between the midpoint of the reference level of the final negative transitions of each pulse of positive polarity and the next positive transition. To determine the transitions that make up each pulse, the function pulsesep evaluates the state levels of the input signal using the histogram method. The function defines all areas that intersect the upper boundary of the lower state and the lower boundary of the upper state.

  • S = pulsesep(x,Fs) — determines the sampling rate Fs.

  • S = pulsesep(x,t) — determines the sampling moments t.

  • s,initcross = pulsesep(___) — returns moments initcross the average reference level of the first positive polarity transitions. You can specify an input combination of any of the above syntax options.

  • pulsesep(___, out=:plot) — plots the signal and darkens the areas between each pulse, where the interval between pulses is calculated. The function marks the position of the middle intersections and their corresponding reference level. The function also plots state levels and their associated lower and upper bounds. The boundaries can be adjusted using a name-value argument. "Tolerance".

Arguments

Input arguments

# x is a two— level signal

+ the real vector

Details

A two-level signal defined as a real vector. If the signal does not contain at least two transitions, the function returns an empty matrix. The first moment in time in x respond .

# Fs — sampling rate
positive real scalar

Details

The sampling frequency, specified as a positive real scalar, expressed in Hz.

# t — selection of time points
vector

Details

A selection of time points, set as a vector. Vector length t must be equal to the length of the input two-level signal x.

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 (default) | scalar

Details

The average reference level as a percentage of the signal amplitude, set as a scalar. For more information, see The average reference level.

# Polarity — the polarity of the pulse

+ "positive" (by default) | "negative"

Details

The polarity of the pulse, set as "positive" or "negative". If specified "positive" the function searches for pulses with positive initial transitions (positive polarity). If specified "negative" the function searches for pulses with negative initial transitions (negative polarity). For more information, see Pulse polarity.

# StateLevels — lower and upper state levels

+ the real vector

Details

The levels of the lower and upper states, defined as a vector of real values with the size 1 on 2. The first element is the lower state level. The second element is the upper state level. If the parameter StateLevels not specified, the function evaluates the state levels based on the input signal using the histogram method.

# Tolerance — tolerance levels

+ 2 (by default) | scalar

Details

Tolerance levels (the boundaries of the lower and upper states), set as a scalar, expressed as a percentage. The boundaries of the lower and upper states are expressed as the state level plus or minus a multiple of the difference between the state levels. For more information, see State-level tolerances.

Типы данных

Float64

# out — type of output data

+ :plot (by default) | :data

Details

Type of output data:

  • :plot — the function returns a graph;

  • :data — the function returns data.

Output arguments

# s — intervals between pulses

+ vector

Details

The intervals between pulses in seconds, returned as a vector. The interval between pulses is defined as the time between the moments of the average reference level of the final transition of one pulse and the initial transition of the next pulse. For more information, see Interval between pulses.

Because pulsesep uses interpolation to determine the moments of the average reference level, s It may contain values that do not correspond to the sampling moments of the two-level signal. x.

# initcross — the moments of the average reference level of the initial transition

+ vector

Details

The moments of the average reference level of the initial transition, returned as a vector.

# finalcross — the moments of the average reference level of the final transition

+ vector

Details

The moments of the average reference level of the final transition, returned as a vector.

# nextcross — the moments of the average reference level of the initial transition after the final transition of the previous pulse

+ vector

Details

The moments of the average reference level of the initial transition after the final transition of the previous pulse, returned as a vector.

# midlev — signal value

+ scalar

Details

The signal value corresponding to the average reference level, returned as a scalar.

Additional Info

The average reference level

Details

The average reference level in a two-level signal with a lower state level and the upper state level equal to

The moment of the average reference level

Details
  • Let indicates the average reference level.

  • Let and denote two consecutive sampling moments corresponding to the signal values closest to .

  • Let and denote the values of the signal at the moment and .

The moment of the average reference level is

Pulse polarity

Details

If the initial transition of the pulse is positive, the pulse has a positive polarity. This figure shows a positive polarity pulse.

dutycycle 1 en

Similarly, an impulse of positive polarity (with a positive increase) has an end state greater 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.

dutycycle 2 en

In other words, an impulse of negative polarity (with a negative increase) has an initial state greater 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 — the level of the lower state, and — the level of the upper state. Replace the first term in the equation with to get the tolerance area for the upper state level.

Interval between pulses

Details

The pulse interval is the time difference between the moment of the average reference level of the final transition of one pulse and the moment of the average reference level of the initial transition of the next pulse.

Literature

  1. IEEE® Standard on Transitions, Pulses, and Related Waveforms. IEEE Standard 181, 2003.