开发者

Least squares optimal scaling

I have two waveforms which are linked by a numerical facto开发者_运维问答r. I need to use optimal scaling (least squares) between the two waveforms to calculate this factor in Matlab. Unfortunately I have no idea how to do this. The two wave forms are seismic signals related by the velocity of the seismic waves, which I'm trying to calculate. Any ideas? need more info?


Call W1 and W2 the two vectors. For this to work, they must be column vectors. Transpose them if they are rows instead of columns. Then if we wish to find the value of k such that W1 = k*W2, just use backslash.

k = W2\W1;

Backslash here gives you a linear regression (least squares) estimator, as requested. This does not handle the unknown phase shift case of course.


one cheesy way to estimate the linear factor without having to deal with phase shift is to compute the ratio of the estimated scales of the waves. the cheesiest way is to use standard deviation:

k = std(W1) / std(W2);

if you care about robustness, I would substitute in the MAD or the IQR; the MAD is the median absolute deviation, which you can (somewhat inefficiently) 'inline' as so:

MAD = @(x)(median(abs(bsxfun(@minus,x,median(x)))));
k = MAD(W1) / MAD(W2);

the IQR is the interquartile range, which requires a proper quantile computation. you can implement this inefficiently using sort. I leave this as an exercise to the reader.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜