pafsim.processor.waveform
Module Contents
- class pafsim.processor.waveform.WaveformGenerator(name: str, **kwargs)
Bases:
pafsim.processor.Processor
The WaveformGenerator generates time series (voltages) of different waveforms (e.g. sine, random).
Construct a WaveformGenerator object :param name: The unique name of theGenerator :type name: str
- kwargs:
fs (float): The sampling rate at which to generate the time series [Hz]. Defaults to 1000 Hz duration (float): The duration of the signal [seconds]. Defaults to 1s gain (float): Gain factor to the amplitude of the signal. Defaults to 1 freq (List[float]): When using the sinus mode generates sines at the frequencies [Hz]. defaults to fs / 4 phase (float): When using the sinus mode adds a phase offset [rad]. Defaults to 0 period (float): When using the sweep mode sets the sweep length in seconds. Defaults to duration f0 (float): When using the sweep mode sets the start frequency of the sweep [Hz]. Defaults to fs / 8 f1 (float): When using the sweep mode sets the stop frequency of the sweep [Hz]. Defaults to fs / 4 method (str): When using the sweep mode sets the sweep method. Defaults to ‘linear’ mean (float): When using the noise mode, sets the mean of the signal devitaion (float): When using the noise mode, sets the deviation of the signal from the mean antennas (int): The number of antennas to generate signals for. Defaults to 2 pol (int): The number of polarization to generate signals for. Defaults to 2 mode (str): The waveform mode,
sinus -> Generates addtive sine wave signals (default) sweep -> Generates sweep signals noise -> Generates noise signals rect -> Generates rectangluar signals
- property default: str
Default process function
- property shape: tuple
The shape of the output array
- Returns:
The shape
- Return type:
tuple
- N_INPUT = 0
- I_FORMAT
- O_FORMAT = ['A', 'P', 'T']
- sinus() numpy.ndarray
Processing function to generate addtive sine waves for a baseband signal
- Returns:
The output array
- Return type:
np.ndarray
- noise() numpy.ndarray
Processing function to generate noise for a baseband signal
- Returns:
The output array
- Return type:
np.ndarray
- sweep() numpy.ndarray
Processing function to generate sweeps for a baseband signal
- Returns:
The output array
- Return type:
np.ndarray
- rect() numpy.ndarray
Processing function to generate rects for a baseband signal
- Returns:
The output array
- Return type:
np.ndarray
- plot(path='', figsize=(8, 4))
Plotting function to plot the time series
- Parameters:
path (str, optional) – If not set to “” it stores the plot in the given directory. Defaults to “”.
figsize (tuple, optional) – Size of the plotted figure. Defaults to (8,4).