function [loss]=hata(R,f,h_1,h_2,ty); % Loss in decibels from the Hata model % r_km %R=10; % f_mhz %f=1; % h_1 (m) %h_1=30; % h_2 (m) %h_2=10; % Type: 1=small to medium city, 2=large city, 3=suburban, 4=open area %ty=1; loss=69.55+26.16*log10(f)-13.82*log10(h_1)+(44.9-6.55*log10(h_1))*log10(R); if (ty~=2) loss=loss-(1.1*log10(f)-0.7)*h_2+1.56*log10(f)-0.8; else if (f<200) loss=loss-8.29*(log10(1.54*h_2)).^2+1.1; else loss=loss-3.2*(log10(11.75*h_2)).^2+4.97; end end if (ty==3) loss=loss-5.4-2*(log10(f/28)).^2; elseif (ty==4) loss=loss-40.94-4.78*(log10(f)).^2+18.33*log10(f); end