We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents dc25537 + d33dae5 commit 140df4eCopy full SHA for 140df4e
1 file changed
commpy/channels.py
@@ -94,7 +94,7 @@ def awgn(input_signal, snr_dB, rate=1.0):
94
snr_linear = 10**(snr_dB/10.0)
95
noise_variance = avg_energy/(2*rate*snr_linear)
96
97
- if type(input_signal[0]) == complex:
+ if isinstance(input_signal[0], complex):
98
noise = (sqrt(noise_variance) * randn(len(input_signal))) + (sqrt(noise_variance) * randn(len(input_signal))*1j)
99
else:
100
noise = sqrt(2*noise_variance) * randn(len(input_signal))
0 commit comments