We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 428f8a7 commit e7b053aCopy full SHA for e7b053a
commpy/channels.py
@@ -90,7 +90,7 @@ def awgn(input_signal, snr_dB, rate=1.0):
90
Output signal from the channel with the specified SNR.
91
"""
92
93
- avg_energy = sum(input_signal * input_signal)/len(input_signal)
+ avg_energy = sum(abs(input_signal) * abs(input_signal))/len(input_signal)
94
snr_linear = 10**(snr_dB/10.0)
95
noise_variance = avg_energy/(2*rate*snr_linear)
96
0 commit comments