Previously, in NPM Javascript to compute Attenuation By Atmospheric Gases ( ITU-R P.676-9), the Javascript Library is published on NPM that computes the attenuation (unit of dB loss per km) given the frequency, temperature and the atmospheric pressure (unit of hPa).
with the latest commits to the package AttenuationByAtmosphericGases version 2.0.0, the library allows also computing the attenuation for water vapour.
As referenced in Page 15 of ITU-R P.676-9, the water vapour attenuation regarding to frequency of the radiowave, temperature, atmospheric pressure (unit of hPa) and the water-vapour density (unit of g/m3) is given in the following formula:
Example:
1 2 3 4 5 6 | var GetWaterAttenuation = require('attenuationbyatmosphericgases').GetWaterAttenuation; let frequency = 10; let temperature = 15; let pressure = 1013; // hpa let density = 7.5; // g/m3 console.log(GetWaterAttenuation(frequency, temperature, pressure, density)); |
var GetWaterAttenuation = require('attenuationbyatmosphericgases').GetWaterAttenuation; let frequency = 10; let temperature = 15; let pressure = 1013; // hpa let density = 7.5; // g/m3 console.log(GetWaterAttenuation(frequency, temperature, pressure, density));
Frequency ranges: This library supports from 0 to 350 GHz.
Technology Stack
The library is built on Javascript and made public on NPM: https://www.npmjs.com/package/attenuationbyatmosphericgases
Github
Contributions are welcome: https://github.com/DoctorLai/AttenuationByAtmosphericGases
- Fork it!
- Create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am ‘Add some feature’
- Push to the branch: git push origin my-new-feature
- Submit a pull request
Unit Tests
Unit tests are built on mocha and chai the Javascript unit testing framework, and you can run tests via npm test.
1 2 3 4 5 | describe('water', function() { it('water', function() { GetWaterAttenuation(10, 15, 1013, 7.5).should.be.closeTo(0.28112047608612034, 1e-3); }); }); |
describe('water', function() { it('water', function() { GetWaterAttenuation(10, 15, 1013, 7.5).should.be.closeTo(0.28112047608612034, 1e-3); }); });
Next Post: Verify & plan 28 GHz Propagation with Ease (5G CW Transmitter)