lmlib.utils.beta.poly_filter(y, ab, g, poly_degree=0)#

Performs edge detection applying joint line models

Uses polynomial of oder ‘poly_degree’ to filter signal. (for poly_degree=0, the filter leads to a moving average filter) example: sphx_glr_generated_examples_12-lssm-costs-filters-example-ex121.0-sc-filter.py

  • y (array_like of shape=(K,) of floats) – observation vector

  • ab (tuple (a,b)) –

    • a (int, >0): left-sided window length (>0)

    • b (int, >0): right-sided window length (>0)

  • g (tuple (g_a, g_b) of float) –

    Effective number of samples under the left-sided and right-sided window, see CostSegment.
    • g_a (float, >0): left-sided window length (>0)

    • g_b (float, >0): right-sided window length (>0)

  • g_a (float) – Effective number of samples under the right-sided window, see CostSegment.

  • poly_degree (int) – degree of polynomial to fit; default: 0 (constant value, i.e., moving average)


  • y0 (ndarray of shape(K,) of floats) – average estimate

  • error (ndarray of shape(K,) of floats) – squared error of fit