Digital Signal Processing

This module holds two different things :

  • First the dsp function, that takes a configuration object as a parameter, and render directly the signals to be sent to the modulator

  • And other functions that will be called by the dsp function and that will take individual (i.e. not configuration object) parameters.

qosst_alice.dsp.dsp_alice(config: Configuration) Tuple[ndarray, ndarray, ndarray]

Execute Digital Signal Processing given the configuration.

Parameters:

config (Configuration) – configuration object containing information for DSP.

Returns:

sequence to send, quantum sequence (without pilots, Zadoff-Chu and padded zeros), symbols.

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray]

qosst_alice.dsp.dsp_alice_params(modulation_cls: Type[Modulation], variance: float, modulation_size: int, num_symbols: int, symbol_rate: float, roll_off: float, frequency_shift: float, pilots_amplitudes: ndarray, pilots_frequencies: ndarray, zc_length: int, zc_root: int, zc_rate: float, num_zeros_start: int, num_zeros_end: int, dac_rate: float, pulsed: bool = False, load_final_sequence: bool = False, save_final_sequence: bool = False, final_sequence_path: str | PathLike[str] = '', save_quantum_sequence: bool = False, quantum_sequence_path: str | PathLike[str] = '', load_symbols: bool = False, save_symbols: bool = False, symbols_path: str | PathLike[str] = '') Tuple[ndarray, ndarray, ndarray]

Use the DSP of Alice to generate the sequence to the DAC using parameters.

Parameters:
  • modulation_cls (Type[Modulation]) – modulation class to generate the symbols.

  • variance (float) – variance of the modulation to generate.

  • modulation_size (int) – modulation size in case of a finite modulation. Must be a power of 2. Must be a square for QAM. Set any value for Gaussian.

  • num_symbols (int) – number of symbols to generate.

  • symbol_rate (float) – symbol rate. Must be less than the dac rate.

  • roll_off (float) – roll off. Must be between 0 and 1.

  • frequency_shift (float) – frequency shift of the quantum symbols.

  • pilots_amplitudes (np.ndarray) – list of the amplitudes of the pilots.

  • pilots_frequencies (np.ndarray) – list of the frequencies of the pilots.

  • zc_length (int) – length of the Zadoff-Chu sequence. Must be coprime with the root.

  • zc_root (int) – root of the Zadoff-Chu sequence. Must be coprime with the length.

  • zc_rate (float) – rate of the Zadoff-Chu sequence. Must be less than the DAC rate. If 0 is given, the DAC rate is used.

  • num_zeros_start (int) – number of zeros to pad before the Zadoff-Chu sequence.

  • num_zeros_end (int) – number of zeros to pad after the end of the quantum sequence.

  • dac_rate (float) – dac rate.

  • pulsed (bool, optional) – if False, raised cosine filtering is used. If True, rectangular filtering is used. Defaults to False.

  • load_final_sequence (bool, optional) – load the final sequence instead of generating it if True. Defaults to False.

  • save_final_sequence (bool, optional) – save the final sequence if True. Defaults to False.

  • final_sequence_path (QOSSTPath, optional) – path to load or save the final sequence. Defaults to “”.

  • save_quantum_sequence (bool, optional) – save the quantum sequence if True. Defaults to False.

  • quantum_sequence_path (QOSSTPath, optional) – path to save the quantum sequence. Defaults to “”.

  • load_symbols (bool, optional) – load the symbols instead of generating them if True. Defaults to False.

  • save_symbols (bool, optional) – save the symbols if True. Defaults to False.

  • symbols_path (QOSSTPath, optional) – path to load or save the quantum symbols. Defaults to “”.

Returns:

sequence to send, quantum sequence (without pilots, Zadoff-Chu and padded zeros), symbols.

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray]

qosst_alice.dsp.generate_baseband_sequence(modulation_cls: Type[Modulation], variance: float, modulation_size: int, num_symbols: int, load_symbols: bool = False, load_symbols_path: str | PathLike[str] = '', save_symbols: bool = False, save_symbols_path: str | PathLike[str] = '') ndarray

Generate symbols for modulation, variance, modulation size and number of symbols.

Parameters:
  • modulation_cls (Type[Modulation]) – modulation class.

  • variance (float) – variance.

  • modulation_size (int) – size of the modulation.

  • num_symbols (int) – number of symbols to generate.

  • load_symbols (bool, optional) – load the symbols instead of generating them if True. Defaults to False.

  • load_symbols_path (QOSSTPath, optional) – path to load the quantum symbols. Defaults to “”.

  • save_symbols (bool, optional) – save the symbols if True. Defaults to False.

  • save_symbols_path (QOSSTPath, optional) – path to save the quantum symbols. Defaults to “”.

Returns:

array of the symbols.

Return type:

np.ndarray

qosst_alice.dsp.upsample(sequence: ndarray, upsample_ratio: int) ndarray

Upsample sequence by upsample_ratio.

Parameters:
  • sequence (np.ndarray) – sequence to be upsampled.

  • upsample_ratio (int) – upsample ratio.

Returns:

the upsampled sequence.

Return type:

np.ndarray

qosst_alice.dsp.apply_rrc_filter(sequence: ndarray, length: int, roll_off: float, symbol_period: float, sampling_rate: float) ndarray

Filter sequence with a Root Raised Cosine filter.

Parameters:
  • sequence (np.ndarray) – sequence to be filter.

  • length (int) – length of the RRC filter.

  • roll_off (float) – roll off of the RRC filter.

  • symbol_period (float) – sampling period, in seconds.

  • sampling_rate (float) – sampling rate in Hz.

Returns:

filtered sequence.

Return type:

np.ndarray

qosst_alice.dsp.apply_rectangular_filter(sequence: ndarray, length: int, cyclic_ratio: float, symbol_period: float, sampling_rate: float) ndarray

Filter sequence with rectangular filter.

Parameters:
  • sequence (np.ndarray) – sequence to be filter.

  • length (int) – length of the rectangular filter.

  • cyclic_ratio (float) – cyclic ratio of the rectangular filter.

  • symbol_period (float) – sampling period, in seconds.

  • sampling_rate (float) – sampling rate in Hz.

Returns:

filtered sequence

Return type:

np.ndarray

qosst_alice.dsp.shift_sequence(sequence: ndarray, frequency_shift_value: float, sampling_rate: float) ndarray

Shift the sequence by frequency_shit_value.

Parameters:
  • sequence (np.ndarray) – the sequence to be shifted.

  • frequency_shift_value (float) – the shift to apply in Hz.

  • sampling_rate (float) – the sampling rate in Hz.

Returns:

shifted sequence.

Return type:

np.ndarray

qosst_alice.dsp.add_frequency_multiplexed_pilots(sequence: ndarray, pilots_frequencies: ndarray, pilots_amplitudes: ndarray, sampling_rate: float) ndarray

Add pilots to the sequence, multiplexed in frequency.

Parameters:
  • sequence (np.ndarray) – sequence to which add the pilots to.

  • pilots_frequencies (np.ndarray) – list of pilots frequencies, in Hz.

  • pilots_amplitudes (np.ndarray) – list of pilots amplitudes.

  • sampling_rate (float) – sampling rate, in Hz.

Returns:

sequence with pilots added.

Return type:

np.ndarray

qosst_alice.dsp.add_zc(sequence: ndarray, root: int, length: int, repeat: int = 1) ndarray

Add Zadoff-Chu sequence at the beginning of the sequence.

Parameters:
  • sequence (np.ndarray) – sequence to which add the Zadoff-Chu sequence to.

  • root (int) – root of the Zadoff-Chu sequence.

  • length (int) – length of the Zadoff-Chu sequence.

  • repeat (int, optional) – repeat each element by this amount, useful to change the rate. Default to 1.

Returns:

sequence with the Zadoff-Chu sequence added.

Return type:

np.ndarray

qosst_alice.dsp.add_zeros(sequence: ndarray, num_zeros_start: int, num_zeros_end: int) ndarray

Add zeros at the beginning and end of the sequence.

It adds num_zeros_start ad the beginning and num_zeros_end at then end.

Parameters:
  • sequence (np.ndarray) – sequence to which add the zeros to.

  • num_zeros_start (int) – number of zeros in the beginning.

  • num_zeros_end (int) – number of zeros at the end.

Returns:

sequence with padded zeros.

Return type:

np.ndarray