Update few experimental figures
This commit is contained in:
21
matlab/src/circlefit.m
Normal file
21
matlab/src/circlefit.m
Normal file
@@ -0,0 +1,21 @@
|
||||
function [xc,yc,R,a] = circlefit(x,y)
|
||||
%
|
||||
% [xc yx R] = circfit(x,y)
|
||||
%
|
||||
% fits a circle in x,y plane in a more accurate
|
||||
% (less prone to ill condition )
|
||||
% procedure than circfit2 but using more memory
|
||||
% x,y are column vector where (x(i),y(i)) is a measured point
|
||||
%
|
||||
% result is center point (yc,xc) and radius R
|
||||
% an optional output is the vector of coeficient a
|
||||
% describing the circle's equation
|
||||
%
|
||||
% x^2+y^2+a(1)*x+a(2)*y+a(3)=0
|
||||
%
|
||||
% By: Izhak bucher 25/oct /1991,
|
||||
x=x(:); y=y(:);
|
||||
a=[x y ones(size(x))]\[-(x.^2+y.^2)];
|
||||
xc = -.5*a(1);
|
||||
yc = -.5*a(2);
|
||||
R = sqrt((a(1)^2+a(2)^2)/4-a(3));
|
11
matlab/src/unwrapphase.m
Normal file
11
matlab/src/unwrapphase.m
Normal file
@@ -0,0 +1,11 @@
|
||||
function [unwraped_phase] = unwrapphase(frf, f, args)
|
||||
|
||||
arguments
|
||||
frf
|
||||
f
|
||||
args.f0 (1,1) double {mustBeNumeric} = 1
|
||||
end
|
||||
|
||||
unwraped_phase = unwrap(frf);
|
||||
[~,i] = min(abs(f - args.f0));
|
||||
unwraped_phase = unwraped_phase - 2*pi*round(unwraped_phase(i)./(2*pi));
|
Reference in New Issue
Block a user