How to force numerator and denominator coefficients to be >0 in tfest?
조회 수: 13 (최근 30일)
이전 댓글 표시
Hi! I have two timeseries, and I am using tfest to estimate the transfer function between them. I need the coefficients of both the numerator and denominator to be >= 0. Is there anyway I can force this constraint?
댓글 수: 0
답변 (1개)
Michael Hawks
2018년 10월 17일
Estimating transfer functions from noisy data can be tricky, but forcing values to be >= 0 is pretty easy so I'll stick to that part of your question.
You could use (for example);
ratio = max( [numerator,0] ) ./ max( [denominator, 0] );
This will replace any negative or NaN values with 0.
Ratios of very small noisy numbers can be unstable, so you can also regularize this a bit with
ratio = ( max( [numerator,0] ) + eps ) ./ ( max( [denominator, 0] ) + eps );
eps is a built-in variable that is essentially the least-significant bit in floating point notation, so this adds a tiny amount onto both numerator and denominator. This only matters for very very small values, but avoids the ratio blowing up for denominator near zero, and approaches 1 in the limit of both numerator and denominator going to zero.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Transfer Function Models에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!