-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConverter.java
50 lines (38 loc) · 1.12 KB
/
Converter.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
public class Converter {
public static double WattToDbm(double a) {
return 10 * Math.log10(a / 0.001);
}
public static double WattToDbw(double a) {
return 10 * Math.log10(a);
}
public static double WattToMWatt(double a) {
return a * 1000;
}
public static double MWattToDbm(double a) {
return 10.0 * Math.log10(a);
}
public static double MWattToDbw(double a) {
return 10 * Math.log10(a / 1000);
}
public static double MWattToWatt(double a) {
return a / 1000;
}
public static double DbwToDbm(double a) {
return a + 30;
}
public static double DbwToWatt(double a) {
return Math.pow(10, a / 10);
}
public static double DbwToMWatt(double a) {
return Math.pow(10, (a + 30) / 10);
}
public static double DbmToWatt(double a) {
return Math.pow(10, a / 10) * 0.001;
}
public static double DbmToMWatt(double a) {
return Math.pow(10, a / 10);
}
public static double DbmToDbw(double a) {
return a - 30;
}
}