<< filtic | FOSSEE_Signal_Processing_Toolbox | findpeaks >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > filtord

# filtord

Determine the filter order.

### Syntax

    n = filtord(b, a)
    n = filtord(sos)
    n = filtord(d)

### Parameters

b:

  Vector. The numerator coefficients of the filter's transfer function.

a:

  Vector. The denominator coefficients of the filter's transfer function.

sos:

  Matrix. The second-order sections representation of the filter. A K-by-6 matrix where each row corresponds to the coefficients of a second-order filter.

d:

  Digital filter object. Represents a digital filter designed using the `designfilt` function.

n:

  Integer. The order of the filter.

### Description

This function computes the order of a filter based on its representation: - `n = filtord(b, a)` computes the filter order for a causal rational system function specified by the numerator coefficients `b` and denominator coefficients `a`. - `n = filtord(sos)` computes the filter order for a filter specified by the second-order sections matrix `sos`. Each row of `sos` corresponds to the coefficients of a second-order filter. - `n = filtord(d)` computes the filter order for a digital filter object `d`. Use the `designfilt` function to generate `d`.

### Examples

    // Compute the filter order for a transfer function:
    b = [1, 2, 3]
    a = [1, 0.5, 0.25]
    n = filtord(b, a)

    // Compute the filter order for a second-order sections matrix:
    sos = [1, 0.5, 0.25, 1, -0.5, 0.25]
    n = filtord(sos)

### See also

- convol

### Authors

- Parthasarathi Panda

Report an issue
<< filtic | FOSSEE_Signal_Processing_Toolbox | findpeaks >>