@@ -143,7 +143,7 @@ def linear(
143
143
144
144
145
145
@export
146
- def ebn0_to_esn0 (ebn0 : npt .ArrayLike , bits_per_symbol : int , rate : int = 1 ) -> npt .NDArray [np .float64 ]:
146
+ def ebn0_to_esn0 (ebn0 : npt .ArrayLike , bits_per_symbol : int , code_rate : int = 1 ) -> npt .NDArray [np .float64 ]:
147
147
r"""
148
148
Converts from $E_b/N_0$ to $E_s/N_0$.
149
149
@@ -154,7 +154,7 @@ def ebn0_to_esn0(ebn0: npt.ArrayLike, bits_per_symbol: int, rate: int = 1) -> np
154
154
Arguments:
155
155
ebn0: Bit energy $E_b$ to noise PSD $N_0$ ratio in dB.
156
156
bits_per_symbol: The number of coded bits per symbol $\log_2 M$, where $M$ is the modulation order.
157
- rate : Code rate $r = k/n$, where $k$ is the number of information bits and $n$ is the
157
+ code_rate : Code rate $r = k/n$, where $k$ is the number of information bits and $n$ is the
158
158
number of coded bits.
159
159
160
160
Returns:
@@ -165,26 +165,26 @@ def ebn0_to_esn0(ebn0: npt.ArrayLike, bits_per_symbol: int, rate: int = 1) -> np
165
165
166
166
.. ipython:: python
167
167
168
- sdr.ebn0_to_esn0(5, 2, rate =2/3)
168
+ sdr.ebn0_to_esn0(5, 2, code_rate =2/3)
169
169
170
170
Convert from $E_b/N_0 = 10$ dB to $E_s/N_0$ for a 16-QAM signal with $r = 1$.
171
171
172
172
.. ipython:: python
173
173
174
- sdr.ebn0_to_esn0(10, 4, rate =1)
174
+ sdr.ebn0_to_esn0(10, 4, code_rate =1)
175
175
176
176
Group:
177
177
conversions-snrs
178
178
"""
179
179
ebn0 = np .asarray (ebn0 ) # Energy per information bit
180
- ecn0 = ebn0 + db (rate ) # Energy per coded bit
180
+ ecn0 = ebn0 + db (code_rate ) # Energy per coded bit
181
181
esn0 = ecn0 + db (bits_per_symbol ) # Energy per symbol
182
182
return esn0
183
183
184
184
185
185
@export
186
186
def ebn0_to_snr (
187
- ebn0 : npt .ArrayLike , bits_per_symbol : int , rate : int = 1 , samples_per_symbol : int = 1
187
+ ebn0 : npt .ArrayLike , bits_per_symbol : int , code_rate : int = 1 , samples_per_symbol : int = 1
188
188
) -> npt .NDArray [np .float64 ]:
189
189
r"""
190
190
Converts from $E_b/N_0$ to $S/N$.
@@ -196,7 +196,7 @@ def ebn0_to_snr(
196
196
Arguments:
197
197
ebn0: Bit energy $E_b$ to noise PSD $N_0$ ratio in dB.
198
198
bits_per_symbol: The number of coded bits per symbol $\log_2 M$, where $M$ is the modulation order.
199
- rate : Code rate $r = k/n$, where $k$ is the number of information bits and $n$ is the
199
+ code_rate : Code rate $r = k/n$, where $k$ is the number of information bits and $n$ is the
200
200
number of coded bits.
201
201
samples_per_symbol: The number of samples per symbol $f_s / f_{sym}$.
202
202
@@ -208,18 +208,18 @@ def ebn0_to_snr(
208
208
209
209
.. ipython:: python
210
210
211
- sdr.ebn0_to_snr(5, 2, rate =2/3, samples_per_symbol=1)
211
+ sdr.ebn0_to_snr(5, 2, code_rate =2/3, samples_per_symbol=1)
212
212
213
213
Convert from $E_b/N_0 = 10$ dB to $S/N$ for a 16-QAM signal with $r = 1$ and 4 samples per symbol.
214
214
215
215
.. ipython:: python
216
216
217
- sdr.ebn0_to_snr(10, 4, rate =1, samples_per_symbol=4)
217
+ sdr.ebn0_to_snr(10, 4, code_rate =1, samples_per_symbol=4)
218
218
219
219
Group:
220
220
conversions-snrs
221
221
"""
222
- esn0 = ebn0_to_esn0 (ebn0 , bits_per_symbol , rate = rate ) # SNR per symbol
222
+ esn0 = ebn0_to_esn0 (ebn0 , bits_per_symbol , code_rate = code_rate ) # SNR per symbol
223
223
snr = esn0 - db (samples_per_symbol ) # SNR per sample
224
224
return snr
225
225
@@ -230,7 +230,7 @@ def ebn0_to_snr(
230
230
231
231
232
232
@export
233
- def esn0_to_ebn0 (esn0 : npt .ArrayLike , bits_per_symbol : int , rate : int = 1 ) -> npt .NDArray [np .float64 ]:
233
+ def esn0_to_ebn0 (esn0 : npt .ArrayLike , bits_per_symbol : int , code_rate : int = 1 ) -> npt .NDArray [np .float64 ]:
234
234
r"""
235
235
Converts from $E_s/N_0$ to $E_b/N_0$.
236
236
@@ -241,7 +241,7 @@ def esn0_to_ebn0(esn0: npt.ArrayLike, bits_per_symbol: int, rate: int = 1) -> np
241
241
Arguments:
242
242
esn0: Symbol energy $E_s$ to noise PSD $N_0$ ratio in dB.
243
243
bits_per_symbol: The number of coded bits per symbol $\log_2 M$, where $M$ is the modulation order.
244
- rate : Code rate $r = k/n$, where $k$ is the number of information bits and $n$ is the
244
+ code_rate : Code rate $r = k/n$, where $k$ is the number of information bits and $n$ is the
245
245
number of coded bits.
246
246
247
247
Returns:
@@ -252,20 +252,20 @@ def esn0_to_ebn0(esn0: npt.ArrayLike, bits_per_symbol: int, rate: int = 1) -> np
252
252
253
253
.. ipython:: python
254
254
255
- sdr.esn0_to_ebn0(5, 2, rate =2/3)
255
+ sdr.esn0_to_ebn0(5, 2, code_rate =2/3)
256
256
257
257
Convert from $E_s/N_0 = 10$ dB to $E_b/N_0$ for a 16-QAM signal with $r = 1$.
258
258
259
259
.. ipython:: python
260
260
261
- sdr.esn0_to_ebn0(10, 4, rate =1)
261
+ sdr.esn0_to_ebn0(10, 4, code_rate =1)
262
262
263
263
Group:
264
264
conversions-snrs
265
265
"""
266
266
esn0 = np .asarray (esn0 )
267
267
ecn0 = esn0 - db (bits_per_symbol ) # Energy per coded bit
268
- ebn0 = ecn0 - db (rate ) # Energy per information bit
268
+ ebn0 = ecn0 - db (code_rate ) # Energy per information bit
269
269
return ebn0
270
270
271
271
@@ -314,7 +314,7 @@ def esn0_to_snr(esn0: npt.ArrayLike, samples_per_symbol: int = 1) -> npt.NDArray
314
314
315
315
@export
316
316
def snr_to_ebn0 (
317
- snr : npt .ArrayLike , bits_per_symbol : int , rate : int = 1 , samples_per_symbol : int = 1
317
+ snr : npt .ArrayLike , bits_per_symbol : int , code_rate : int = 1 , samples_per_symbol : int = 1
318
318
) -> npt .NDArray [np .float64 ]:
319
319
r"""
320
320
Converts from $S/N$ to $E_b/N_0$.
@@ -326,7 +326,7 @@ def snr_to_ebn0(
326
326
Arguments:
327
327
snr: Signal-to-noise ratio $S/N$ in dB.
328
328
bits_per_symbol: The number of coded bits per symbol $\log_2 M$, where $M$ is the modulation order.
329
- rate : Code rate $r = k/n$, where $k$ is the number of information bits and $n$ is the
329
+ code_rate : Code rate $r = k/n$, where $k$ is the number of information bits and $n$ is the
330
330
number of coded bits.
331
331
samples_per_symbol: The number of samples per symbol $f_s / f_{sym}$.
332
332
@@ -338,20 +338,20 @@ def snr_to_ebn0(
338
338
339
339
.. ipython:: python
340
340
341
- sdr.snr_to_ebn0(5, 2, rate =2/3, samples_per_symbol=1)
341
+ sdr.snr_to_ebn0(5, 2, code_rate =2/3, samples_per_symbol=1)
342
342
343
343
Convert from $S/N = 10$ dB to $E_b/N_0$ for a 16-QAM signal with $r = 1$ and 4 samples per symbol.
344
344
345
345
.. ipython:: python
346
346
347
- sdr.snr_to_ebn0(10, 4, rate =1, samples_per_symbol=4)
347
+ sdr.snr_to_ebn0(10, 4, code_rate =1, samples_per_symbol=4)
348
348
349
349
Group:
350
350
conversions-snrs
351
351
"""
352
352
snr = np .asarray (snr ) # SNR per sample
353
353
esn0 = snr_to_esn0 (snr , samples_per_symbol = samples_per_symbol ) # Energy per symbol
354
- ebn0 = esn0_to_ebn0 (esn0 , bits_per_symbol , rate = rate ) # Energy per information bit
354
+ ebn0 = esn0_to_ebn0 (esn0 , bits_per_symbol , code_rate = code_rate ) # Energy per information bit
355
355
return ebn0
356
356
357
357
0 commit comments