Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rf-exposure-calculator

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rf-exposure-calculator - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "rf-exposure-calculator",
"version": "1.0.1",
"version": "1.0.2",
"description": "RF Exposure Calculator for HAM Radio",

@@ -5,0 +5,0 @@ "main": "src/index.js",

RF Exposure Calculator
----------------------
```js
import { RFExposureCalculator } from 'rf-exposure-calculator';
const calculator = new RFExposureCalculator();
const results = calculator.calculateRFExposure(
10, // Power in Watts
1, // [0-1]: Mode Duty Cycle
{ // TX Duty Cycle
tx: 2, // Time spent transmitting
rx: 3 // Time spent listening
},
1.3, // Antenna gain in dBi
7.200, // Operating frequency
true, // `true` for a controlled environment, `false` for uncontrolled
true // Whether or not to include the effects of ground reflection
);
```
```json
{
"max_allowed_power_density": 17.3611,
"min_safe_distance_in_feet": 0.2919
}
```

@@ -14,3 +14,2 @@ export class RFExposureCalculator {

const Gf = includeGroundReflectionEffects ? 0.64 : 0.25;
const Pwr = 1000.0 * powerInWatts * modeDutyCycle * this.timeAveragePercent(txDutyCycle.tx, txDutyCycle.rx, controlledEnvironment ? 6 : 30);

@@ -83,3 +82,3 @@ const Eirp = Pwr * Math.pow(10, antennaGainInDbi / 10); // EIRP in milliwatts, adjusting for antenna gain

if (txMinutes >= interval) {
// Edge Case: `txMinutes` is longer than the `interval`. AKA: Transmitting 100% of the time.
// `txMinutes` is longer than the `interval`. Transmitting 100% of the time.
return 1.0;

@@ -89,3 +88,3 @@ }

if (cycle >= interval) {
// One full cycle is longer than the interval. AKA: What percent of the interval is spent transmitting?
// One full cycle is longer than the interval.
return (txMinutes / interval);

@@ -92,0 +91,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc