<< invfreq | FOSSEE_Signal_Processing_Toolbox | invfreqz >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > invfreqs

# invfreqs

Fit filter B(s)/A(s) to the complex frequency response H at frequency points F.

### Syntax

    [B, A] = invfreqs(H, F, nB, nA)
    [B, A] = invfreqs(H, F, nB, nA, W)
    [B, A] = invfreqs(H, F, nB, nA, W, iter, tol, 'trace')

### Parameters

H:

  Desired complex frequency response.

F:

  Frequency (must be the same length as H).

nA:

  Order of the denominator polynomial A.

nB:

  Order of the numerator polynomial B.

W:

  (optional) Vector of weights (must be the same length as F). Default is uniform weighting.

iter:

  (optional) Number of iterations for refinement. Default is no iterations.

tol:

  (optional) Tolerance for iterations. Default is no tolerance.

'trace':

  (optional) Enables tracing of the iterative process.

B:

  Coefficients of the numerator polynomial.

A:

  Coefficients of the denominator polynomial.

### Description

The `invfreqs` function fits a rational transfer function B(s)/A(s) to the desired complex frequency response `H` at frequency points `F`. The orders of the numerator and denominator polynomials are specified by `nB` and `nA`, respectively. Optionally, the fit-errors can be weighted using the weights `W`. The function supports iterative refinement of the solution, specified by `iter` and `tol`.

Note: The core implementation of this function relies on `invfreq.sci`.

### Examples

    // Define the desired frequency response (H) and frequency points (F)
    F = linspace(0, 10, 100); // Frequency points
    H = 1 ./ (1 + %i * F);    // Desired frequency response (low-pass filter)

    // Define the orders of the numerator and denominator polynomials
    nB = 1 // Order of the numerator
    nA = 1 // Order of the denominator

    // Fit the filter
    [B, A] = invfreqs(H, F, nB, nA)

### Bibliography

- J. O. Smith, "Techniques for Digital Filter Design and System Identification with Application to the Violin, Ph.D. Dissertation, Elec. Eng. Dept., Stanford University, June 1983.

- https://ccrma.stanford.edu/~jos/filters/FFT_Based_Equation_Error_Method.html

### See also

- invfreq — Fit filter B(z)/A(z) or B(s)/A(s) to complex frequency response at frequency points F.

### Authors

- FOSSEE Team
- toolbox@scilab.in

Report an issue
<< invfreq | FOSSEE_Signal_Processing_Toolbox | invfreqz >>