📄 threest.m
字号:
function [s,V] = threest(z,rho,theta)% function THREEST.M% Interpolation Method using three steps% Usage: [s,V] threest(z,rho,theta)% Where: z = M by N matrix with samples in frequency domain% rho, theta radius and angles of data points% s = interpolated matrix% V = vector that includes [X0 dkx dky fl]% Example using cubic spline interpolation frinctionclose all% Variables bursts = size(z,1); pul_burst = size(z,2); rho = rho.*(4*pi/3e8); %% frequency matrix in rad/mt rhov = rho(1,:); drho = rhov(2) - rhov(1); ac = theta(bursts,1) - theta(1,pul_burst);
% Interpolation, First step (radial) flops(0); s = zeros(size(z)); t = linspace(theta(1,pul_burst), theta(bursts,1), bursts); t1 = meshgrid(t, 1:pul_burst)'; fxd = rho.*cos(theta); fxi = zeros(size(fxd)); fyd = rho.*sin(theta); fyi = fxi; for a = 1:pul_burst, for b = 1:bursts, ind = find(t1(b,a)==theta(:,a)); if isempty(ind), % interpolate ind = max(find(t1(b,a)>theta(:,a))); th0 = theta(ind,a); th1 = theta(ind+1,a); gg = (pi + th0 - th1)/2; bb = (pi + th0 + th1 - 2*t1(b,a))/2; rr = rho(b,a)*sin(gg)/sin(bb); fxi(b,a) = rr*cos(t1(b,a)); fyi(b,a) = rr*sin(t1(b,a)); d1 = ((fxd(ind,a) - fxd(ind+1,a))^2 + (fyd(ind,a) - fyd(ind+1,a))^2)^.5; d2 = ((fxd(ind,a) - fxi(b,a))^2 + (fyd(ind,a) - fyi(b,a))^2)^.5; s(b,a) = (z(ind+1,a) - z(ind,a))*d2/d1 + z(ind,a); else % don't interpolate fxi(b,a) = fxd(ind,a); fyi(b,a) = fyd(ind,a); s(b,a) = z(ind,a); end; end; end flo = flops;
% Interpolation, Second step (x) z=s; rho = (fxi.^2 + fyi.^2).^.5; theta = atan2(fyi,fxi); rho = rho./(4*pi/3e8); [s,V]=normal_l(z,rho,theta); %Modifly this line according to desired function %[s,V]=normal_c(z,rho,theta);
%[s,V]=sinky(z,rho,theta); V(4)=V(4) + flo;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -