<< prony | FOSSEE_Signal_Processing_Toolbox | pulsesep >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > pulseperiod

# pulseperiod

This function estimate pulse period of real vector X.

### Syntax

    p=pulseperiod(x)
    p=pulseperiod(x, Fs)
    p=pulseperiod(x, t)
    p=pulseperiod (x, t, 'Polarity', pol)
    p=pulseperiod(x, t, 'MidPercentReferenceLevel', N )
    p=pulseperiod(x, t, 'Tolerance', M)
    p=pulseperiod(x, t,'StateLevels', O)
    [p initialcross finalcross nextcross midreference]=pulseperiod(x)
    [p initialcross finalcross nextcross midreference]=pulseperiod(x, t)
    [p initialcross finalcross nextcross midreference]=pulseperiod(x, t)
    [p initialcross finalcross nextcross midreference]=pulseperiod(x, t, 'Polarity', pol)
    [p initialcross finalcross nextcross midreference]=pulseperiod(x, t, 'MidPercentReferenceLevel', N )
    [p initialcross finalcross nextcross midreference]= pulseperiod(x, t, 'Tolerance', M)
    [p initialcross finalcross nextcross midreference]= pulseperiod(x, t,'StateLevels', O)
    [p initialcross finalcross nextcross midreference]= pulseperiod(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'.

p:

  returns a vector of difference between the mid-crossings of the initial transition of each positive-polarity pulse and the next positive-going transition

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

nextcross:

  returns a vector of next cross values of bilevel waveform transitions X

midreference:

  return mid reference value corrosponding to mid percent reference value.

### Examples

    x = fscanfMat("macros/pulsedata_x.txt");
    t = fscanfMat("macros/pulsedata_t.txt");
    clf
    p = pulseperiod(x,t,'fig','ON')
    //also it generates a pulse plot with pulse period

### See also

### Authors

- Jitendra Singh

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