% Written by Min-Hua Huang
% June 9, 2011
% Estimate the Marcum Q-function in "h" forms.
% Section 4.7 in "Indefinite Integration of the Gamma Integral".
% input:hmQ(a,b,m); a is parameter alpha; b is parameter beta; 
% m is parameter m; 
% c is a considerably large number to replace the infinite upper limit.
function fv=hmQ(a,b,m)
format long; pre=300; c=100; 
cf=exp(-a^2/2)/(2^m*c^m*exp(-c)*h(m-1,-c,pre)); product=1; sum=0;
for i=0:1:20
core=c^(m+i)*exp(-c/2)*h(m-1+i,-c/2,pre)-b^(2*(m+i))*exp(-b^2/2)*h(m-1+i,-b^2/2,pre);
    if i==0;
       product=1;
    else
       product=product/(i*(m-1+i)); 
    end
sum=sum+core*product*(a/2)^(2*i); 
end
fv=cf*sum;
