• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help converting decimal result into dBm

Hi guys

i am having some troubles in trying to setup the following in PHP

i have a xml file that reads out the direct results of my card.

i want to parse it to php in code igniter but i am having some troubles 

i need to convert a decimal result into dBm, which i found the code below

and want to print it on the php page with a menu bar signal kind of thing similar to wifi

basically it reads a DVB signal from the xml file and outputs it in php page but the current result is output in decimal which is weird cause i need to convert it to dBM

i have the following code to convert it to dBm

PHP Code:
function calcDb() {
frm document.calc;
    if (
frm.perc.value == null || frm.perc.value.length == 0) {
perc frm.perc.value;
db Math.round(1000000000*20*(Math.log(perc*0.01)/Math.log(10)))/1000000000;
document.getElementById("answerDb").innerHTML db " %";

which currently i need to input result manually

atm i am reading those with this.

PHP Code:
<td align="center">Signal:</td>
foreach ($signal as $item): 
   echo '<td align="center">'.$item->firstChild->nodeValue.'</td>';
    <td align="center">SNR:</td>
foreach ($snr as $item): 
   echo '<td align="center">'.$item->firstChild->nodeValue.'</td>';
which fetches the result from







and the actual result is descbribed on the picture below
i would like to display the results in dbm   example  SNR  50%  OR 70%   dB  and display it in a graphic similar to this one on pic2
fe has lock. status:SCVYL signal:60% snr:80% ber:0 unc:0


Attached Files Thumbnail(s)

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.