- 积分
- 67
- 注册时间
- 2002-6-14
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2002-6-14 12:52:30
|
显示全部楼层
来自 北京
回复: 【求助】用matlab怎么处理超声图象来获得图象分形维数,谢谢!
try this program:
function [H, r, x, y] = hurstVTP (A)
## usage: [H, r] = hurstVTP (A)
##
## Computes the Hurst parameter H of the vector A using the variance-time
## plot method.
##
## Use the variance computed over intervals of different lenghts. Plotted on
## a log-log diagram, var (x) versus the interval length (y) should be
## least-squares interpolated by a line of slope beta=2H. r is the
## correlation coefficient and gives a "reliability factor" of the H
## estimate: values higher than 0.9 should be expected.
## I don't know about any data on the precision of this method. All I know
## is that it cannot provide a confidence interval measure.
##
## Leland, Taqqu, Willinger, Wilson, "On the Self-Similar Nature of Ethernet
## Traffic (Extended Version)", IEEE/ACM Trans. on Networking Vol.2, Num.1,
## 1994.
##
## Put in the public domain by Francesco Potorti` <F.Potorti@cnuce.cnr.it>
## Mon Aug 28 17:07:26 MET 1995
if (!is_vector(A))
error ("A should be a vector");
endif
# m is the minimum interval length over which the var is computed. M is
# the minimum number of intervals over which that same quantity is
# computed. k is the number of interval lengths per decade used for the
# computation. minp is the minimum number of points that must be used.
# maxp is the maximum number of points that must be used.
m = 10;
M = 10;
k = 5;
minp = 5;
maxp = 20;
r = length (A);
minr = ceil (m*M*10^((minp-1)/k));
if (r < minr)
error (sprintf ("A should have at least %d elements\n", minr));
endif
# n is the number of points we use to interpolate the line on a log-log
# plot whose slope is 2H. x is a vector containing their abscissae, y
# contains their ordinates, that is, the variance of the increments of the
# vector A at distances x.
n = min (maxp, floor (k * log10(r/m/M)));
x = floor (logspace (log10(m), log10(r/M), n))';
y = zeros (n, 1);
cumA = cumsum (A);
for i = 1:n
xi = x(i);
Y = cumA (xi:xi:r);
sets = length (Y);
Y = Y - prepad (Y(1:sets-1), sets);
y(i) = (sumsq(Y) - cumA(sets*xi)^2/sets) / (sets-1);
endfor
x = log (x);
y = log (y);
alfabeta = [ones (size (x)), x] \ y;
H = alfabeta(2) / 2;
if (nargout > 1) r = corrcoef (x, y); endif
endfunction
--------------------------------------------------------------------------------
有问题请告诉我! |
评分
-
1
查看全部评分
-
|