comnum.PaprReduction#

class comnum.PaprReduction#

A PAPR reduction technique for Ofdm.modulate_with and Ofdm.demodulate_with; build it with one of the static methods (clip, clip_filter, slm, pts, tone_reservation, ace, mu_law, exponential).

Examples

>>> import comnum, numpy as np
>>> ofdm = comnum.Ofdm(64, 64)
>>> d = np.exp(2j * np.pi * comnum.Rng(1).uniform(64 * 20))
>>> x, side = ofdm.modulate_with(d, comnum.PaprReduction.slm(8))
>>> bool(np.median(ofdm.papr_db(x)) < np.median(ofdm.papr_db(ofdm.modulate(d))))
True
>>> np.allclose(ofdm.demodulate_with(x, comnum.PaprReduction.slm(8), side=side), d)
True
static ace(constellation, ratio_db, *, iterations=10, step=1.0)#

Active constellation extension, clipping-based (Krongold & Jones 2003).

Parameters:
  • constellation (Constellation) – the alphabet of the data.

  • ratio_db (float) – the clipping ratio (dB).

  • iterations (int) – iterations.

  • step (float) – step of the extension.

Returns:

the technique.

Return type:

PaprReduction

Examples

>>> import comnum
>>> comnum.PaprReduction.ace(comnum.Constellation("qam", 4), 4.0)
PaprReduction.ace(4 dB, 10)
static clip(ratio_db)#

Clipping of the envelope above the average power (Li & Cimini 1998).

Parameters:

ratio_db (float) – the clipping ratio (dB above the average power).

Returns:

the technique.

Return type:

PaprReduction

Examples

>>> import comnum
>>> comnum.PaprReduction.clip(4.0)
PaprReduction.clip(4 dB)
static clip_filter(ratio_db, *, iterations=4)#

Repeated clipping and out-of-band filtering (Armstrong 2002).

Parameters:
  • ratio_db (float) – the clipping ratio (dB).

  • iterations (int) – clipping and filtering passes.

Returns:

the technique.

Return type:

PaprReduction

Examples

>>> import comnum
>>> comnum.PaprReduction.clip_filter(4.0, iterations=2)
PaprReduction.clip_filter(4 dB, 2)
static exponential(degree=2.0)#

Exponential companding (Jiang, Yang & Song 2005).

Parameters:

degree (float) – the degree of the compander.

Returns:

the technique (Ofdm.demodulate expands).

Return type:

PaprReduction

Examples

>>> import comnum
>>> comnum.PaprReduction.exponential(2.0)
PaprReduction.exponential(2)
static mu_law(mu, *, peak_db=9.0)#

μ-law companding (Wang, Tjhung & Ng 1999).

Parameters:
  • mu (float) – the parameter μ.

  • peak_db (float) – the peak of the compander (dB above the average power).

Returns:

the technique (Ofdm.demodulate expands).

Return type:

PaprReduction

Examples

>>> import comnum
>>> comnum.PaprReduction.mu_law(255.0)
PaprReduction.mu_law(255)
static pts(subblocks, *, phases=4, partition='pseudorandom', seed=0)#

Partial transmit sequences (Müller & Huber 1997).

Parameters:
  • subblocks (int) – number of subblocks.

  • phases (int) – number of phase factors.

  • partition (str) – "adjacent", "interleaved" or "pseudorandom".

  • seed (int) – seed of the pseudorandom partition.

Returns:

the technique (its side information is the candidate).

Return type:

PaprReduction

Raises:

ValueError – for an invalid parameter (the message names it).

Examples

>>> import comnum
>>> comnum.PaprReduction.pts(4, phases=2)
PaprReduction.pts(4, 2)
static slm(candidates, *, seed=0)#

Selected mapping (Bäuml, Fischer & Huber 1996).

Parameters:
  • candidates (int) – number of phase sequences.

  • seed (int) – seed of the phase sequences.

Returns:

the technique (its side information is the candidate).

Return type:

PaprReduction

Examples

>>> import comnum
>>> comnum.PaprReduction.slm(8)
PaprReduction.slm(8)
static tone_reservation(n_subcarriers, n_tones, ratio_db, *, seed=0, iterations=20, step=1.0)#

Tone reservation on random tones (Tellado 2000).

Parameters:
  • n_subcarriers (int) – active subcarriers of the modulator.

  • n_tones (int) – reserved tones among them.

  • ratio_db (float) – the target clipping ratio (dB).

  • seed (int) – seed of the choice of the tones.

  • iterations (int) – iterations of the gradient search.

  • step (float) – its step.

Returns:

the technique (Ofdm.data_len drops the reserved tones).

Return type:

PaprReduction

Examples

>>> import comnum
>>> ofdm = comnum.Ofdm(128, 128)
>>> ofdm.data_len(comnum.PaprReduction.tone_reservation(128, 12, 4.0))
116