Skip to content

Pulse Modulate

__init__(alpha=0.8, fs=128000, Rb=400, span=6, type='RRC', prefix_duration=0.082, channel=None, bits_per_symbol=1)

Initializes a pulse modulator, with pulse response \(g(t)\) used to prepare symbols as \(I[n]\) and \(Q[n]\) for modulation. The deployment of the pulse response \(g(t)\) for each channel is illustrated in the figure below.

pageplot

Parameters:

Name Type Description Default
alpha float

Roll-off factor of the RRC pulse.

0.8
fs int

Sampling frequency.

128000
Rb int

Bit rate.

400
span int

Pulse duration in terms of bit periods.

6
type str

Type of pulse.

'RRC'
prefix_duration int

Duration of the pure carrier at the beginning of the vector

0.082
channel str

Channel to be formatted, only \(I\) and \(Q\) are supported.

None
bits_per_symbol int

Number of bits per symbol.

1

Raises:

Type Description
ValueError

If the pulse type is not supported.

ValueError

If the channel is not supported.

Examples:

>>> import argos3
>>> import numpy as np 
>>> 
>>> Xn = np.random.randint(0, 2, 20)
>>> Yn = np.random.randint(0, 2, 20)
>>>
>>> print(Xn)
[0 1 1 1 0 1 1 1 0 0 0 0 0 0 1 0 1 1 1 1]
>>> print(Yn)
[0 0 0 1 0 1 1 0 0 1 0 0 0 1 0 0 1 1 0 1]
>>> 
>>> In = argos3.Encoder(method="NRZ").encode(Xn)
>>> Qn = argos3.Encoder(method="NRZ").encode(Yn)
>>> 
>>> formatter_I = argos3.Formatter(Rb=1000, type="RRC", channel="I", bits_per_symbol=1, prefix_duration=0.01)
>>> formatter_Q = argos3.Formatter(Rb=1000, type="RRC", channel="Q", bits_per_symbol=2, prefix_duration=0.01)
>>> 
>>> dI = formatter_I.apply_format(In, add_prefix=True)
>>> dQ = formatter_Q.apply_format(Qn, add_prefix=True)
>>> 
>>> print(dI[:10])
[-0.07484442 -0.07466479 -0.07461029 -0.07454939 -0.07448207 -0.07440832
 -0.07432813 -0.0742415  -0.07414841 -0.07404887]
>>> 
>>> print(dQ[:10])
[-0.09576597 -0.09565452 -0.09570885 -0.09574086 -0.09575048 -0.09573767
 -0.09570238 -0.0956446  -0.09556429 -0.09546146]
  • Bitstream Plot Example: pageplot
Reference:
EEL7062, Princípios de Sistemas de Comunicação, Richard Demo Souza (Pg. 55)

rrc_pulse(shift=0.0)

Generates the Root Raised Cosine (\(RRC\)) pulse. The \(RRC\) pulse in the time domain is defined by the expression below.

\[ g(t) = \frac{(1 - \alpha) sinc((1- \alpha) t / T_b) + \alpha (4/\pi) \cos(\pi (1 + \alpha) t / T_b)}{1 - (4 \alpha t / T_b)^2} \]
Where
  • \(g(t)\): \(RRC\) pulse in the time domain.
  • \(\alpha\): Roll-off factor of the pulse.
  • \(T_b\): Bit period.
  • \(t\): Time vector.

Parameters:

Name Type Description Default
shift float

Time shift, used to shift the pulse in the time domain.

0.0

Returns:

Name Type Description
rc ndarray

Normalized RRC pulse.

Examples:

  • Impulse Response Example: pageplot

manchester_pulse()

Manchester pulse, defined as the difference of two RRC pulses symmetrically shifted, as shown in the expression below.

\[ g_{MAN}(t) = g_{RRC}(t + T_b/2) - g_{RRC}(t - T_b/2) \]
Where
  • \(g_{MAN}(t)\): Manchester pulse in the time domain.
  • \(g_{RRC}(t)\): RRC pulse in the time domain.
  • \(T_b\): Bit period.
  • \(t\): Time vector.

Examples:

  • Impulse Response Example: pageplot

apply_format(symbols, add_prefix=True)

Applies the formatting process to the input symbols using the initialized pulse. Also adds a prefix to the signal if add_prefix is True. The formatting process is given by:

\[ d(t) = \sum_{n} x[n] \cdot g(t - nT_b) \]
Where
  • \(d(t)\): Formatted signal output.
  • \(x\): Input symbol vector.
  • \(g(t)\): Formatting pulse.
  • \(n\): Bit index.
  • \(T_b\): Bit period.

Parameters:

Name Type Description Default
symbols ndarray

Input symbol vector.

required

Returns:

Name Type Description
out_symbols ndarray

Formatted symbol vector.

add_prefix(symbols)

Adds a pure carrier prefix to the signal. For the \(I\) channel, adds a vector of symbols \(+1\), for the \(Q\) channel, adds a vector of symbols \(0\), with duration of prefix_duration.

Since applying the IQ modulator we have a pure carrier at the beginning of the signal, according to the expression below:

\[ s(t) = 1(t) \cdot \cos(2\pi f_c t) - 0(t) \cdot \sin(2\pi f_c t) \mapsto s(t) = \cos(2\pi f_c t) \]
Where
  • \(s(t)\): Modulated signal.
  • \(1(t)\) and \(0(t)\): Pure carrier prefix.
  • \(f_c\): Carrier frequency.
  • \(t\): Time vector.

Parameters:

Name Type Description Default
symbols ndarray

Symbol vector to be formatted.

required

Returns:

Name Type Description
symbols ndarray

Symbol vector with prefix added.