%
%  transfer_core.m  ver 1.6  April 29, 2015
%
function[H]=...
    transfer_core(freq,fnv,dampv,QE,omn2,omega,omega2,iam,nf,num_columns,i,k,nrb)
%
  H=zeros(nf,1); 
%  
    if(nf>4)
       progressbar;
    end
%
    for s=1:nf   % excitation frequency loop
%
        if(nf>4)
            progressbar(s/nf);
        end    
%
        for r=(1+nrb):num_columns  % natural frequency loop
            if(fnv(r)<1.0e+30)
%
                rho=freq(s)/fnv(r);
                den=1-rho^2+(1i)*2*dampv(r)*rho;
%
                if(abs(den)<1.0e-20)
                    disp(' den error ');
                    return;
                end
                if(abs(omn2(r))<1.0e-20)
                    disp(' omn2 error ');
                    return;
                end                
%
                term=-(QE(i,r)*QE(k,r)/den)/omn2(r);
%        
                if(iam==2)
                    term=term*(1i)*omega(s);                   
                end
                if(iam==3 || iam==4)
                    term=term*(-1)*omega2(s);                    
                end 
                H(s)=H(s)+term;                
%
            end
        end   
%
    end
    progressbar(1);
%
    if(iam==5)
        for s=1:nf   % excitation frequency loop
            H(s)=1/H(s);
        end    
    end