fork download
  1. import numpy as np
  2.  
  3. # Given values
  4. Pt_dBm = 23 # Transmit power in dBm
  5. Gain_rx_dB = 80 # Receiver gain in dB
  6. Bandwidth_Hz = 20e6 # 20 MHz
  7. Noise_Figure_dB = 12 # Noise figure in dB
  8.  
  9. # Step 1: Calculate noise power (dBm)
  10. kT_dBm_Hz = -174 # Thermal noise density in dBm/Hz
  11. Pn_dBm = kT_dBm_Hz + 10 * np.log10(Bandwidth_Hz) + Noise_Figure_dB
  12.  
  13. # Step 2: Received power
  14. Pr_dBm = Pt_dBm + Gain_rx_dB
  15.  
  16. # Step 3: Calculate SNR
  17. SNR_dB = Pr_dBm - Pn_dBm
  18.  
  19. # Output results
  20. print(f"Noise Power (Pn): {Pn_dBm:.2f} dBm")
  21. print(f"Received Power (Pr): {Pr_dBm:.2f} dBm")
  22. print(f"SNR at receiver output: {SNR_dB:.2f} dB")
  23.  
Success #stdin #stdout 0.78s 41400KB
stdin
Standard input is empty
stdout
Noise Power (Pn): -88.99 dBm
Received Power (Pr): 103.00 dBm
SNR at receiver output: 191.99 dB