יישומים בתקשורת — Wi-Fi, בלוטות׳ וסלולר

✦ בנוי על ידי פהד גאנם ✦

fc(n) = 2407 + 5n MHz   |   חפיפה = 22 − 5·|n1 − n2|   |   Prx = Ptx + Gt + Gr − PL1m − 10·n·log10d
6
1
4
802.11g
20 dBm
3.0
30 m

PL = 40.2 + 10 · 3 · log1030 = 40.2 + 30 · 1.477 = 84.5 dB
Prx = 20 + 2 + 2 − 84.5 = −60.5 dBm
−60.5 − (−72) = 11.5 dB
d = 10(24 + 72 − 40.2) / 30 = 101.860 = 72.6 m
22 − 5 · |4 − 1| = 22 − 15 = 7 MHz  →  1 , 6 , 11

Tair = DIFS + CW − 12·σ + Tdata + SIFS + TACK   |   η = L · 8R · Tair
4
1500 B
54 Mbit/s

N = 22 + 8 · (1500 + 38 − 4) = 22 + 8 · 1534 = 12294 bit
⌈12294 / 216⌉ = 57  →  57 · 4 = 228 µs  →  Tdata = 228 + 20 = 248 µs
Tbo = 7.5 · 9 = 67.5 µs
Tair = 28 + 67.5 + 248 + 10 + 28 = 381.5 µs
R = 1500 · 8381.5 µs = 31.45 Mbit/s  →  η = 58 %

fk = 2402 + k MHz, k = 0…78   |   Tslot = 11600 = 625 µs   |   d1d2 = 10ΔP / 10n
5
2
1
2.5
−70 dBm

T = 11600 = 625 µs  |  BW = 79 · 1 = 79 MHz
p = 179 = 1.27 %  →  1600 · 179 = 20.3
d = 10(20 + 70 − 40) / (10 · 2.5) = 102 = 100 m
n = 2 → 1020/20 = 10   |   n = 3 → 1020/30 = 4.6
1020/10n = 100  →  n = 1  ()

Nbit = 1 + ndata + npar + nstop   |   Tchar = Nbitbaud   |   Δmax = 0.59.5 = 5.3 %
9600
A
אין
1
+3 %
'7'

N = 1 + 8 + 0 + 1 = 10  |  Tbit = 19600 = 104.2 µs
Tchar = 1.042 ms  |  960  |  9600 · 810 = 7680 bit/s
12 · 1.042 = 12.5 ms
9.5 · 0.03 = 0.285 < 0.5  → 
3.3 = 5 · R21000 + R2  →  R2 = 1941 Ω ≈ 2 kΩ
ESP32 · Arduino C++
// 3.4  One character from the phone becomes the motor's duty cycle.
// The HC-05 adds no command of its own: what arrives from the air leaves
// the module on two wires. So this sketch only ever reads a UART - the
// same call a sketch printing to the serial monitor already uses.

const int PIN_RX = 16;          // ESP32 RX2 <- module TX, direct
const int PIN_TX = 17;          // ESP32 TX2 -> module RX, 1k / 2k divider
const int PIN_MOTOR = 25;

const long  BAUD   = 9600;
const int   N_BITS = 10;        // 8N1: start + 8 data + stop
const int   PWM_FREQ = 1000;
const int   PWM_BITS = 8;
const int   PWM_MAX  = (1 << PWM_BITS) - 1;
const float T_SLOT_MS = 0.625;  // one Bluetooth slot, from 3.3

void setup() {
  Serial.begin(115200);                              // to the computer
  Serial2.begin(BAUD, SERIAL_8N1, PIN_RX, PIN_TX);   // to the module
  if (!ledcAttach(PIN_MOTOR, PWM_FREQ, PWM_BITS)) {
    Serial.println("ledcAttach failed - no free timer");
  }
  ledcWrite(PIN_MOTOR, 0);
}

void loop() {
  // No delay and no readString: the character may land at any moment and
  // the receive FIFO is small, so the loop must stay free to drain it.
  while (Serial2.available()) {
    char c = Serial2.read();
    if (c < '0' || c > '9') continue;     // the module passes anything through

    int duty = (int)((c - '0') / 9.0 * PWM_MAX + 0.5);
    ledcWrite(PIN_MOTOR, duty);

    float t_char = 1000.0 * N_BITS / BAUD;            // ms, one character
    Serial2.printf("OK %c %d\n", c, duty);            // back to the phone
    Serial.printf("cmd=%c duty=%d/%d Tchar=%.3f ms lat=%.3f ms\n",
                  c, duty, PWM_MAX, t_char, t_char + T_SLOT_MS);
  }
}

N = i² + i·j + j²   |   DR = 3N   |   SIR = 16·DRγ
28
395
7
4.0
4 dB
2G

Scell = 3957 = 56.4  →  56
42 · 56 = 2352  
DR = 3 · 7 = 21 = 4.58
SIR = 4.5846 = 73.5  →  10·log1073.5 = 18.7 dB
98  |  DR = 3.46  |  SIR = 13.8 dB

ncarriers = BW200 kHz   |   Tslot = 4.615 ms8 = 577 µs   |   Σ ci·cj = 0   (i ≠ j)
4
25 MHz
1
160

25 MHz200 kHz = 125  →  124
124 · 8 = 992
T = 4.6158 = 0.577 ms  |  R = 156.250.577 ms = 270.8 kbit/s
140 · 87 = 11207 = 160
1120 − 487 = 153  →  ⌈300153⌉ = 2
🏠