Skip to content

Bandpass Modulate

__init__(fc=None, fs=128000)

Initializes a QPSK modulator in the ARGOS-3 standard. The modulator can be represented by the block diagram shown below.

pageplot

Parameters:

Name Type Description Default
fc float

Carrier frequency.

None
fs int

Sampling frequency.

128000

Raises:

Type Description
ValueError

If the sampling frequency is not greater than twice the carrier frequency. (Nyquist Theorem)

Examples:

>>> import argos3
>>> import numpy as np 
>>> 
>>> X = np.random.randint(0, 2, 20)
>>> Y = np.random.randint(0, 2, 20)
>>>
>>> print(X)
[0 1 1 1 0 1 1 1 0 0 0 0 0 0 1 0 1 1 1 1]
>>> print(Y)
[0 0 0 1 0 1 1 0 0 1 0 0 0 1 0 0 1 1 0 1]
>>> 
>>> symbols_I = argos3.Encoder(method="NRZ").encode(X)
>>> symbols_Q = argos3.Encoder(method="NRZ").encode(Y)
>>> 
>>> formatter_I = argos3.Formatter(Rb=400, type="RRC", channel="I", bits_per_symbol=1, prefix_duration=0.082)
>>> formatter_Q = argos3.Formatter(Rb=400, type="RRC", channel="Q", bits_per_symbol=2, prefix_duration=0.082)
>>> 
>>> dI = formatter_I.apply_format(symbols_I, add_prefix=True)
>>> dQ = formatter_Q.apply_format(symbols_Q, add_prefix=True)
>>> 
>>> modulator = argos3.Modulator(fc=4000)
>>> t, s = modulator.modulate(dI, dQ)
>>> 
>>> print(s[:10])
[-0.07484442 -0.05456886 -0.03230473 -0.00879478  0.01503904  0.03826391
  0.05997333  0.07932302  0.09556429  0.10807341]
>>> print(t[:10])
[0.00000e+00 7.81250e-06 1.56250e-05 2.34375e-05 3.12500e-05 3.90625e-05
  4.68750e-05 5.46875e-05 6.25000e-05 7.03125e-05]
  • Time Domain Example: pageplot
  • Constellation/Phase Example: pageplot
  • Frequency Domain Example: pageplot
  • Pure Carrier Example: pageplot
Reference:
AS3-SP-516-274-CNES (section 3.2.5.3)

modulate(i_signal, q_signal)

Modulates the signals \(d_I\) and \(d_Q\) with a carrier \(f_c\), resulting in the modulated signal \(s(t)\). The modulation process is given by the expression below.

\[ s(t) = d_I(t) \cdot \cos(2\pi f_c t) - d_Q(t) \cdot \sin(2\pi f_c t) \]
Where
  • \(s(t)\): Modulated signal.
  • \(d_I(t)\) and \(d_Q(t)\): Formatted signals corresponding to the \(I\) and \(Q\) channels.
  • \(f_c\): Carrier frequency.
  • \(t\): Time vector.

Parameters:

Name Type Description Default
i_signal ndarray

Signal \(d_I\) corresponding to the \(I\) channel to be modulated.

required
q_signal ndarray

Signal \(d_Q\) corresponding to the \(Q\) channel to be modulated.

required

Returns:

Name Type Description
modulated_signal ndarray

Modulated signal \(s(t)\) result.

t ndarray

Time vector \(t\) corresponding to the modulated signal.

Raises:

Type Description
ValueError

If the signals I and Q do not have the same size.

demodulate(modulated_signal, carrier_length=0.07, carrier_delay=0)

Demodulates the modulated signal \(s(t)\), with phase synchronization using the first carrier_length seconds of carrier.

Parameters:

Name Type Description Default
modulated_signal ndarray

Modulated signal \(s(t)\) to be demodulated.

required
carrier_length float

The length of the carrier for phase synchronization (in seconds).

0.07
carrier_delay float

The delay of the carrier for phase synchronization (in seconds).

0

Returns:

Name Type Description
i_signal ndarray

Signal \(x_I'(t)\) recovered.

q_signal ndarray

Signal \(y_Q'(t)\) recovered.