<< freqz | FOSSEE_Signal_Processing_Toolbox | fwhmjlt >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > fwhm

# fwhm

Compute peak full-width at half maximum (FWHM) or at another level of peak maximum for vector or matrix data.

### Syntax

    f = fwhm(y)
    f = fwhm(x, y)
    f = fwhm(…, "zero")
    f = fwhm(…, "min")
    f = fwhm(…, "alevel", level)
    f = fwhm(…, "rlevel", level)

### Parameters

y:

  Vector or matrix. If `y` is a matrix, FWHM is calculated for each column as a row vector.

x:

  (optional) Vector specifying the sampling points of `y`. If not provided, `x` defaults to 1:length(y).

"zero":

  (optional) Default option. Computes FWHM at half maximum, i.e., 0.5 * max(y).

"min":

  (optional) Computes FWHM at the middle curve, i.e., 0.5 * (min(y) + max(y)).

"alevel":

  (optional) Computes full-width at the given absolute level of `y`. Requires an additional argument `level`.

"rlevel":

  (optional) Computes full-width at the given relative level of peak profile. Requires an additional argument `level`.

level:

  (optional) Scalar specifying the absolute or relative level for FWHM computation.

f:

  Full-width at the specified level. If FWHM does not exist (e.g., for a monotonous function), returns 0.

### Description

The `fwhm` function computes the full-width at half maximum (FWHM) or at another specified level for vector or matrix data `y`. If `y` is a matrix, the function computes FWHM for each column and returns the results as a row vector. The function supports several options for specifying the level at which the width is computed:

- "zero" (default): Computes FWHM at half maximum, i.e., 0.5 * max(y). - "min": Computes FWHM at the middle curve, i.e., 0.5 * (min(y) + max(y)). - "rlevel": Computes full-width at the given relative level of the peak profile, i.e., at `rlevel * max(y)` or `rlevel * (min(y) + max(y))`. For example, `fwhm(…, "rlevel", 0.1)` computes the full width at 10% of the peak maximum. FWHM is equivalent to `fwhm(…, "rlevel", 0.5)`. - "alevel": Computes full-width at the given absolute level of `y`.

The function returns 0 if FWHM does not exist (e.g., for a monotonous function or if the function does not intersect the horizontal line at the specified level).

### Examples

    fwhm([1,2,3;9,-7,0.6],[4,5,6])

### Authors

- FOSSEE Team
- toolbox@scilab.in

Report an issue
<< freqz | FOSSEE_Signal_Processing_Toolbox | fwhmjlt >>