NPM Javascript to compute Attenuation By Atmospheric Gases ( ITU-R P.676-9)

in #utopian-io7 years ago (edited)

ITU-R P.676-9 is proposed by International Telecommunication Union that recommends the Attenuation by atmospheric gases which are influenced by frequency, temperature and atmospheric pressure (unit of hpa).

In case of temperature is not known, the mean temperature can be used, where this can be found in document ITU-R P.1510

In here, we know that the high frequency radiowave is highly impacted by oxygen absorption and water vapour. From the below represented figure , it is estimated that at 60 GHz, the dB/km attenuation is around 15.

image.png
Image Credit

As you can see, the attenuation consists of several mathematically curves fitting from measurement, and this project is to provide a method to compute the dB/km (Attenuation By Atmospheric Gases) given the frequency, temperature and atmospheric pressure.

Technology Stack

The library is built on Javascript and made public on NPM: https://www.npmjs.com/package/attenuationbyatmosphericgases

Github

https://github.com/DoctorLai/AttenuationByAtmosphericGases
Contributions are welcome.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Unit Tests

Unit tests are built on mocha and chai the Javascript unit testing framework, and you can run tests via npm test

/*
  Unit Tests for Attenuation By Atmospheric Gases
  Built on: mocha and chai
  Tests for frequency ranges from 0 to 350 Ghz
*/

var should = require('chai').should(),
    module = require('../index'),
    GetAirAttenuation = module.GetAirAttenuation;

describe('54', function() {
  it('30', function() {
    GetAirAttenuation(30, 13, 1000).should.be.closeTo(0.0207, 1e-3);
  }); 
});

describe('60', function() {
  it('60', function() {
    GetAirAttenuation(60, 13, 1000).should.be.closeTo(15.097, 1e-3);
  }); 
});

describe('62', function() {
  it('61', function() {
    GetAirAttenuation(61, 13, 1000).should.be.closeTo(14.7173, 1e-3);
  }); 
});

describe('66', function() {
  it('65', function() {
    GetAirAttenuation(65, 13, 1000).should.be.closeTo(3.7769, 1e-3);
  }); 
});

describe('120', function() {
  it('100', function() {
    GetAirAttenuation(100, 13, 1000).should.be.closeTo(0.0252, 1e-3);
  }); 
});

describe('350', function() {
  it('200', function() {
    GetAirAttenuation(200, 13, 1000).should.be.closeTo(0.0101, 1e-3);
  }); 
});

image.png

Samples

var GetAirAttenuation = require('attenuationbyatmosphericgases').GetAirAttenuation;
let freq = 60; // 60 GHz
let temperature = 20; // 20 degree
let pressure = 1000; // hpa
console.log(GetAirAttenuation(freq, temperature, pressure));

This gives 14.200501629257202 (dB loss per km).

Frequency ranges

This library supports from 0 to 350 GHz.

Roadmap

Currently, this release (init version) only supports the air (oxygen) absorption. The next version will support water vapour.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

The @OriginalWorks bot has determined this post by @justyy to be original material and upvoted it!

ezgif.com-resize.gif

To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!

Please note that this is a BETA version. Feel free to leave a reply if you feel this is an error to help improve accuracy.

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

看不太懂…平时一般用不到这个…

Hello friend, excellent post. I already follow you and I invite you to go through my blog maybe something you like and you can support me with your vote.

Hey @justyy I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63342.09
ETH 2658.68
USDT 1.00
SBD 2.81