{"id":11,"date":"2017-05-11T23:59:32","date_gmt":"2017-05-11T23:59:32","guid":{"rendered":"https:\/\/propagationtools.com\/wireless\/?p=11"},"modified":"2017-12-10T00:21:41","modified_gmt":"2017-12-10T00:21:41","slug":"free-space-path-loss-calculator-with-api","status":"publish","type":"post","link":"https:\/\/propagationtools.com\/wireless\/free-space-path-loss-calculator-with-api\/","title":{"rendered":"Free Space Path Loss Calculator with API"},"content":{"rendered":"\n<div id=\"fb-root\"><\/div>\n<script>(function(d, s, id) {\n  var js, fjs = d.getElementsByTagName(s)[0];\n  if (d.getElementById(id)) return;\n  js = d.createElement(s); js.id = id;\n  js.src = \"\/\/connect.facebook.net\/en_GB\/sdk.js#xfbml=1&version=v2.6&appId=857807644244147\";\n  fjs.parentNode.insertBefore(js, fjs);\n}(document, 'script', 'facebook-jssdk'));<\/script>\n\n<div class=\"fb-like\" data-href=\"https:\/\/propagationtools.com\/wireless\/wp-json\/wp\/v2\/posts\/11\" data-layout=\"button_count\" data-action=\"like\" data-show-faces=\"false\" data-share=\"false\"><\/div><BR\/><div class='wp_content'><p>Github: <a rel=\"nofollow\" target=\"blank\" href=\"https:\/\/github.com\/DoctorLai\/FreeSpaceCalculator\">https:\/\/github.com\/DoctorLai\/FreeSpaceCalculator<\/a><\/p>\n<p>The Path Loss is often referred to the wireless attenuation (in the unit of <a rel=\"nofollow\" target=\"blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/Decibel\">Decibel i.e. dB<\/a>) between transmitter and receiver, as shown below.<\/p>\n<p><a  href=\"https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/2017\/05\/pathloss.jpg\"><img  title=\"pathloss Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \" loading=\"lazy\" decoding=\"async\" width=\"519\" height=\"149\" src=\"https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/2017\/05\/pathloss.jpg\"  alt=\"pathloss Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \"  class=\"size-medium wp-image-12\" srcset=\"https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/2017\/05\/pathloss.jpg 519w, https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/2017\/05\/pathloss-300x86.jpg 300w, https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/2017\/05\/pathloss-100x29.jpg 100w, https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/2017\/05\/pathloss-200x57.jpg 200w, https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/2017\/05\/pathloss-400x115.jpg 400w, https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/2017\/05\/pathloss-500x144.jpg 500w\" sizes=\"auto, (max-width: 519px) 100vw, 519px\" \/> Free Space Path Loss<\/a><\/p>\n<h2>Free Space Path Loss Formula<\/h2>\n<p>To compute the Path Loss (dB), you will need the following factors:<\/p>\n<ul>\n<li>Emitting Frequency i.e. f (usually seen in the unit of MHz or GHz)<\/li>\n<li>Distance separation between Tx and Rx i.e. (usually seen in the unit of meters of kilo-meters)<\/li>\n<li>Transmitter Antenna Gain (in the unit of dBi)<\/li>\n<li>Receiver Antenna Gain (in the unit of dBi)<\/li>\n<\/ul>\n<p>The path loss (dB) then can be computed via the following formula:<\/p>\n<p><a rel=\"nofollow\" target=\"blank\" href=\"http:\/\/buy.thulasidas.com\/easy-latex\/\"><img  title=\"tex_8c776fc78e980fe399fa4222a5922e10 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \"  alt=\"tex_8c776fc78e980fe399fa4222a5922e10 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \" src='https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/easy-latex-cache\/tex_8c776fc78e980fe399fa4222a5922e10.png' title='\\text{PL}_{dB} = 20\\log_{10}(d) + 20\\log_{10}(f) + 20\\log_{10}(\\frac{4\\pi}{c}) - G_t - G_r ' style='vertical-align:1%' class='tex' alt='\\text{PL}_{dB} = 20\\log_{10}(d) + 20\\log_{10}(f) + 20\\log_{10}(\\frac{4\\pi}{c}) - G_t - G_r ' \/><\/a><\/p>\n<p>Where <a rel=\"nofollow\" target=\"blank\" href=\"http:\/\/www.thulasidas.com\/plugins\/easy-latex\"><img  title=\"tex_283f8305ff6eb45145d2a1d63758d478 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \"  alt=\"tex_283f8305ff6eb45145d2a1d63758d478 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \" src='https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/easy-latex-cache\/tex_283f8305ff6eb45145d2a1d63758d478.png' title='c ' style='vertical-align:1%' class='tex' alt='c ' \/><\/a> is the speed of light in vacuum roughly <img  title=\"tex_6152f50bab643dbd3220d0cbb584a43f Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \"  alt=\"tex_6152f50bab643dbd3220d0cbb584a43f Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \" src='https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/easy-latex-cache\/tex_6152f50bab643dbd3220d0cbb584a43f.png' title='3 \\times 10^8 ' style='vertical-align:1%' class='tex' alt='3 \\times 10^8 ' \/> meters per second. <img  title=\"tex_0a3117ceb000e31cdfb64b84c7f0fa71 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \"  alt=\"tex_0a3117ceb000e31cdfb64b84c7f0fa71 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \" src='https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/easy-latex-cache\/tex_0a3117ceb000e31cdfb64b84c7f0fa71.png' title='d ' style='vertical-align:1%' class='tex' alt='d ' \/> is the distance in the unit of meter and <img  title=\"tex_7a28c7edfc7772451020109504284ed3 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \"  alt=\"tex_7a28c7edfc7772451020109504284ed3 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \" src='https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/easy-latex-cache\/tex_7a28c7edfc7772451020109504284ed3.png' title='f ' style='vertical-align:1%' class='tex' alt='f ' \/> is the emitting frequency in the unit of Hertz.<\/p>\n<p>This can be further simplified to:<\/p>\n<p><img  title=\"tex_5489cc51a56209eeaf40173ed8cdc0fc Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \"  alt=\"tex_5489cc51a56209eeaf40173ed8cdc0fc Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \" src='https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/easy-latex-cache\/tex_5489cc51a56209eeaf40173ed8cdc0fc.png' title='\\text{PL}_{dB} = 20\\log_{10}(d) + 20\\log_{10}(f) + 32.44 - G_t - G_r ' style='vertical-align:1%' class='tex' alt='\\text{PL}_{dB} = 20\\log_{10}(d) + 20\\log_{10}(f) + 32.44 - G_t - G_r ' \/> <\/p>\n<p>Where <img  title=\"tex_0a3117ceb000e31cdfb64b84c7f0fa71 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \"  alt=\"tex_0a3117ceb000e31cdfb64b84c7f0fa71 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \" src='https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/easy-latex-cache\/tex_0a3117ceb000e31cdfb64b84c7f0fa71.png' title='d ' style='vertical-align:1%' class='tex' alt='d ' \/> is the distance in the unit of kilo-meter and <img  title=\"tex_7a28c7edfc7772451020109504284ed3 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \"  alt=\"tex_7a28c7edfc7772451020109504284ed3 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools \" src='https:\/\/propagationtools.com\/wireless\/wp-content\/uploads\/easy-latex-cache\/tex_7a28c7edfc7772451020109504284ed3.png' title='f ' style='vertical-align:1%' class='tex' alt='f ' \/> is the emitting frequency in the unit of Mhz.<\/p>\n<h2>Path Loss Calculator Online<\/h2>\n<p>This calculator is available in the <a  href=\"https:\/\/propagationtools.com\/wireless\/free-space-path-loss-calculator-with-api\/\">non-AMP version<\/a> of this page.<\/p>\n<form class='form-inline'>\nFrequency (MHz): <input type=number id=mhz value=947><br \/>\nDistance (Meter): <input type=number id=meter value=100><br \/>\nTransmitter Antenna Gain (dBi): <input type=number id=gt value=0><br \/>\nReceiver Antenna Gain (dBi): <input type=number id=gr value=0><br \/>\n<input type=button id=compute value=\"Calculate Path Loss\" onclick=\"javascript:var mhz=parseFloat(document.getElementById('mhz').value);var meter=parseFloat(document.getElementById('meter').value);var gt=parseFloat(document.getElementById('gt').value);var gr=parseFloat(document.getElementById('gr').value);document.getElementById('pl').value=20*Math.log10(mhz*meter*0.001)+32.45-gt-gr;\"><br \/>\nPath Loss (dB): <input type=number id=pl readonly><br \/>\n<\/form>\n<h2>Free Space Path Loss API<\/h2>\n<p>The Free Space Path Loss API is implemented in <a target=\"blank\" href=\"https:\/\/helloacm.com\/php7-shortens-the-google-page-crawling-time\/\">PHP<\/a>, and the <a rel=\"nofollow\" target=\"blank\" href=\"https:\/\/github.com\/DoctorLai\/FreeSpaceCalculator\/blob\/master\/api_freespace.php\">full source code<\/a> is:<\/p>\n<pre lang='php'>\r\nhttps:\/\/propagationtools.com\r\n$mhz = (float)($_GET['mhz'] ?? ($_POST['mhz'] ?? 0));\r\n$meter = (float)($_GET['meter'] ?? ($_POST['meter'] ?? 0));\r\n$gt = (float)($_GET['gt'] ?? ($_POST['gt'] ?? 0)); \r\n$gr = (float)($_GET['gr'] ?? ($_POST['gr'] ?? 0));\r\n$data = array();\r\n$data['err'] = array();\r\nif ($mhz &lt;= 0) {\r\n  $data['err'][] = 'Frequency (MHz) Invalid';\r\n}\r\nif ($meter &lt;= 0) {\r\n  $data['err'][] = 'Distance (Meter) Invalid';\r\n}\r\nif (count($data['err']) == 0) {\r\n  $data['db'] = 20.0 * log10($mhz * $meter * 0.001) + 32.44 - $gt - $gr;\r\n}\r\nheader(\"Access-Control-Allow-Origin: *\");  \r\nheader('Content-Type: application\/json');\r\ndie(json_encode($data));  \r\n<\/pre>\n<p>For example, you can invoke the API at the following end-point:<\/p>\n<pre lang='api'>\r\nhttps:\/\/propagationtools.com\/api\/freespace\/?mhz=947&meter=234&gt=15&gr=10\r\n<\/pre>\n<p>and, the returned format is JSON:<\/p>\n<pre lang='json'>\r\n{\"err\":[],\"db\":54.361316728268}\r\n<\/pre>\n<p>And, you could pass the parameters via the POST method:<\/p>\n<pre lang='bash'>\r\n? curl -s -X POST \"https:\/\/propagationtools.com\/api\/freespace\/\" -d \"mhz=947\" -d \"meter=234\"\r\n{\"err\":[],\"db\":79.361316728268}\r\n<\/pre>\n<p>The antenna gain values (dBi) for transmitter and receiver are optional, which are zeros by default.<\/p>\n\n<div class=\"fb-like\" data-href=\"https:\/\/propagationtools.com\/wireless\/wp-json\/wp\/v2\/posts\/11\" data-layout=\"button_count\" data-action=\"like\" data-show-faces=\"false\" data-share=\"false\"><\/div>  <font color=gray>926 words<\/font> \n\n<BR\/><\/div> <div>\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<!-- propagation blog bot -->\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-5311181282559050\"\n     data-ad-slot=\"8425782656\"\n     data-ad-format=\"auto\"><\/ins>\n<script>\n(adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/div><div>\n\n<\/div><div class=\"addthis_toolbox addthis_default_style addthis_32x32_style\">\n<a class=\"addthis_button_facebook\"><\/a>\n<a class=\"addthis_button_twitter\"><\/a>\n<a class=\"addthis_button_linkedin\"><\/a>\n<a class=\"addthis_button_google_plusone_share\"><\/a>\n<a class=\"addthis_button_reddit\"><\/a>\n<a class=\"addthis_button_email\"><\/a>\n<\/div><BR\/>","protected":false},"excerpt":{"rendered":"<p>Github: https:\/\/github.com\/DoctorLai\/FreeSpaceCalculator The Path Loss is often referred to the wireless attenuation (in the unit of Decibel i.e. dB) between transmitter and receiver, as shown below. Free Space Path Loss Free Space Path Loss Formula To compute the Path Loss (dB), you will need the following factors: Emitting Frequency i.e. f (usually seen in the<span class=\"continue-reading\"> <a href=\"https:\/\/propagationtools.com\/wireless\/free-space-path-loss-calculator-with-api\/\"><B>Continue Reading<\/B> &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":12,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,9,7],"tags":[10,11],"class_list":["post-11","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-api","category-free-space-path-loss","category-online-tools","tag-free-space","tag-path-loss-calculator-with-api"],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/propagationtools.com\/wireless\/wp-json\/wp\/v2\/posts\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/propagationtools.com\/wireless\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/propagationtools.com\/wireless\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/propagationtools.com\/wireless\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/propagationtools.com\/wireless\/wp-json\/wp\/v2\/comments?post=11"}],"version-history":[{"count":0,"href":"https:\/\/propagationtools.com\/wireless\/wp-json\/wp\/v2\/posts\/11\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/propagationtools.com\/wireless\/wp-json\/wp\/v2\/media\/12"}],"wp:attachment":[{"href":"https:\/\/propagationtools.com\/wireless\/wp-json\/wp\/v2\/media?parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/propagationtools.com\/wireless\/wp-json\/wp\/v2\/categories?post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/propagationtools.com\/wireless\/wp-json\/wp\/v2\/tags?post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}