<< pulsesep | FOSSEE_Signal_Processing_Toolbox | pwelch >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > pulsewidth

# pulsewidth

This function estimate pulse width of real vector X.

### Syntax

    w=pulsewidth(x)
    w=pulsewidth(x, Fs)
    w=pulsewidth(x, t)
    w=pulsewidth (x, t, 'Polarity', pol)
    w=pulsewidth(x, t, 'MidPercentReferenceLevel', N )
    w=pulsewidth(x, t, 'Tolerance', M)
    w=pulsewidth(x, t,'StateLevels', O)
    [w initialcross finalcross midreference]=pulsewidth(x)
    [w initialcross finalcross midreference]=pulsewidth(x, Fs)
    [w initialcross finalcross midreference]=pulsewidth(x, t)
    [w initialcross finalcross midreference]=pulsewidth(x, t, 'Polarity', pol)
    [w initialcross finalcross midreference]=pulsewidth(x, t, 'MidPercentReferenceLevel', N )
    [w initialcross finalcross midreference]= pulsewidth(x, t, 'Tolerance', M)
    [w initialcross finalcross midreference]= pulsewidth(x, t,'StateLevels', O)
    [w initialcross finalcross midreference]= pulsewidth(x, t,'StateLevels', O, 'fig', on or off)

### Parameters

x:

  real vector.

Fs:

  specifies the sample rate, Fs, as a positive scalar, where the first sample instant corresponds to a time of zero.

t:

  defiene instant sample time t as vector with same length of x, or specifies the sample rate, t, as a positive scalar.

Polarity:

  specify the polarity of the pulse as either 'positive' or 'negative', where the default value is 'positive'.

MidPercentReferenceLevel:

  specify the mid percent reference leves as a percentage, default value of N is 50.

Tolerance:

  define the tolerance value as real scaler value, where default value of M is 2.0.

StateLevels:

  define the lower and upper state levels as two element real vector.

fig:

  specify the logical input value to display figure as one of 'on' or 'off', where the default input in 'off'.

w:

  returns a vector of difference between the mid-crossings of the initial and final transitions of each positive-polarity pulse found in the input signal.

initialcross:

  returns a vector of initial cross values of bilevel waveform transitions X.

finalcross:

  returns a vector of final cross values of bilevel waveform transitions X.

midreference:

  return mid reference value corrosponding to mid percenr reference value.

### Examples

    x = fscanfMat("macros/pulsedata_x.txt");
    t = fscanfMat("macros/pulsedata_t.txt");
    clf
    p = pulsewidth(x,t,'fig','ON')
    //it also generates a pulse with pulse width  and annotations

### See also

### Authors

- Jitendra Singh

Report an issue
<< pulsesep | FOSSEE_Signal_Processing_Toolbox | pwelch >>