필터 지우기
필터 지우기

How does fillgaps work?

조회 수: 8 (최근 30일)
nt_ba
nt_ba 2019년 12월 6일
답변: Ondrej Mokrý 2024년 1월 16일
Hello!
I was wondering how https://www.mathworks.com/help/signal/ref/fillgaps.html works. As it is implied, fillgaps replaces any NaNs present in a signal x with estimates extrapolated from forward and reverse autoregressive fits of the remaining samples. As far as i know, an autoregressive model specifies that the output variable depends linearly on its own previous values and on a stochastic term. So, why it is written that forward values are also taken into account?
Is there an equation for the fillgaps command? As well as an explanation of its parameters?
Please, i really need an answer on this topic.
Thanks in advance!
  댓글 수: 1
Paramonte
Paramonte 2022년 2월 12일
Same question here

댓글을 달려면 로그인하십시오.

답변 (1개)

Ondrej Mokrý
Ondrej Mokrý 2024년 1월 16일
Consider a signal with only a single gap for simplicity. The function fillgaps takes the context prior to the gap (cropped to length maxlen, if this parameter is set), estimates an AR model for this context (the order of this model can also be set) and uses this model to predict (extrapolate) the missing samples one by one, given the linear dependence governed by the estimated coefficients of the AR model.
For a signal segment x and model order p, we can efficiently perform extrapolation of n samples (e.g., corresponding to length of the gap) as follows:
af = arburg(x, p); % length of the signal x has to be at least p+1
zf = filtic(1, af, flip(x(end-p+1:end)));
prediction = filter(1, af, zeros(1, n), zf); % produces the extrapolated segment of length n
To utilize also the samples coming after the gap, fillgaps repeats the same extrapolation procedure with flipped (reversed) version of this context after the gap. Clearly, this reverse extrapolation has to be flipped again to fit the original signal.
The forward and backward predictions are then linearly cross-faded to produce the final signal filled in the gap.

카테고리

Help CenterFile Exchange에서 Conditional Mean Models에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by