||
下面两个软件计算的结果完全不同!
ylm Normalized real spherical harmonics (Dahlen & Tromp B.72)
Calculates unit-normalized real spherical harmonics, 计算单位归一化实球谐函数
sphere-lab Hilbert Space Methods in Signal Processing
总感觉计算结果不太对,比如:
ylm(60,20,pi/2-20*pi/180,97*pi/180) = 0.1587
sphHarm(60,20,pi/2-20*pi/180,97*pi/180) = -0.1338 + 0.1123i
real_sphHarm(60,20,pi/2-20*pi/180,97*pi/180) = -0.1892
究竟球谐函数Ylm到底是多少?实球谐函数和复球谐函数的关系?
球谐(Spherical Harmonics,SH)函数有实数形式和复数形式,SH函数一般是在虚数上定义的。
实际公式和代码对应起来,应该是sphere-lab 结果更为可靠!
function Ylm = real_sphHarm(l, m, lTheta, lPhi)
% Ylm = sphHarm(l, m, lTheta, lPhi)
% Create a real spherical harmonic function of degree 'l' and order 'm'. See
% README.txt for more details.
% Author: chenchao.
% Created: Mar 18, 2022.
if (mod(m, 2) == 1)
neg1_m = -1;
else
neg1_m = 1;
end
% TODO: We currently calculate Y_{lm} by definition, but it could be faster.
if (m > 0)
Ylm = 1/sqrt(2)*(sphHarm(l, -m, lTheta, lPhi) + sphHarm(l, m, lTheta, lPhi) * neg1_m);
elseif (m == 0)
Ylm = sphHarm(l, 0, lTheta, lPhi);
else
Ylm = 1i/sqrt(2)*(sphHarm(l, m, lTheta, lPhi) - sphHarm(l, -m, lTheta, lPhi) * neg1_m);
end
Ylm = real(Ylm);
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-21 20:34
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社