pathsim.blocks.rf.sources module
- pathsim.blocks.rf.sources.triangle_wave(t, f)[source]
triangle wave with amplitude ‘1’ and frequency ‘f’
- pathsim.blocks.rf.sources.square_wave(t, f)[source]
square wave with amplitude ‘1’ and frequency ‘f’
- class pathsim.blocks.rf.sources.SquareWaveSource(frequency=1, amplitude=1, phase=0)[source]
Bases:
BlockSource block that generates an analog square wave
Note
This block is purely analog with no internal events. Not to be confused with a clock that has internal scheduled events
- Parameters:
- update(t)[source]
The ‘update’ method is called iteratively for all blocks to evaluate the algbebraic components of the global system ode and resolve algebraic loops (fixed-point iteraion).
It is meant for instant time blocks (blocks that dont have a delay due to the timestep, such as Amplifier, etc.) and updates the ‘outputs’ of the block directly based on the ‘inputs’ and possibly internal states.
It computes and returns the absolute difference between the new output and the previous output (before the call) to track convergence of the fixed-point iteration.
Note
The implementation of the ‘update’ method in the base ‘Block’ class is intended as a fallback and is not performance optimized. Special blocks might reimplement this method differently for higher performance, for example SISO or MISO blocks.
- class pathsim.blocks.rf.sources.TriangleWaveSource(frequency=1, amplitude=1, phase=0)[source]
Bases:
BlockSource block that generates an analog triangle wave
- Parameters:
- update(t)[source]
The ‘update’ method is called iteratively for all blocks to evaluate the algbebraic components of the global system ode and resolve algebraic loops (fixed-point iteraion).
It is meant for instant time blocks (blocks that dont have a delay due to the timestep, such as Amplifier, etc.) and updates the ‘outputs’ of the block directly based on the ‘inputs’ and possibly internal states.
It computes and returns the absolute difference between the new output and the previous output (before the call) to track convergence of the fixed-point iteration.
Note
The implementation of the ‘update’ method in the base ‘Block’ class is intended as a fallback and is not performance optimized. Special blocks might reimplement this method differently for higher performance, for example SISO or MISO blocks.
- class pathsim.blocks.rf.sources.SinusoidalSource(frequency=1, amplitude=1, phase=0)[source]
Bases:
BlockSource block that generates a sinusoid wave
- Parameters:
- update(t)[source]
The ‘update’ method is called iteratively for all blocks to evaluate the algbebraic components of the global system ode and resolve algebraic loops (fixed-point iteraion).
It is meant for instant time blocks (blocks that dont have a delay due to the timestep, such as Amplifier, etc.) and updates the ‘outputs’ of the block directly based on the ‘inputs’ and possibly internal states.
It computes and returns the absolute difference between the new output and the previous output (before the call) to track convergence of the fixed-point iteration.
Note
The implementation of the ‘update’ method in the base ‘Block’ class is intended as a fallback and is not performance optimized. Special blocks might reimplement this method differently for higher performance, for example SISO or MISO blocks.
- class pathsim.blocks.rf.sources.GaussianPulseSource(amplitude=1, f_max=1000.0, tau=0.0)[source]
Bases:
BlockSource block that generates a gaussian pulse
- Parameters:
- update(t)[source]
The ‘update’ method is called iteratively for all blocks to evaluate the algbebraic components of the global system ode and resolve algebraic loops (fixed-point iteraion).
It is meant for instant time blocks (blocks that dont have a delay due to the timestep, such as Amplifier, etc.) and updates the ‘outputs’ of the block directly based on the ‘inputs’ and possibly internal states.
It computes and returns the absolute difference between the new output and the previous output (before the call) to track convergence of the fixed-point iteration.
Note
The implementation of the ‘update’ method in the base ‘Block’ class is intended as a fallback and is not performance optimized. Special blocks might reimplement this method differently for higher performance, for example SISO or MISO blocks.
- class pathsim.blocks.rf.sources.StepSource(amplitude=1, tau=0.0)[source]
Bases:
BlockSource block that generates a unit step
- Parameters:
- update(t)[source]
The ‘update’ method is called iteratively for all blocks to evaluate the algbebraic components of the global system ode and resolve algebraic loops (fixed-point iteraion).
It is meant for instant time blocks (blocks that dont have a delay due to the timestep, such as Amplifier, etc.) and updates the ‘outputs’ of the block directly based on the ‘inputs’ and possibly internal states.
It computes and returns the absolute difference between the new output and the previous output (before the call) to track convergence of the fixed-point iteration.
Note
The implementation of the ‘update’ method in the base ‘Block’ class is intended as a fallback and is not performance optimized. Special blocks might reimplement this method differently for higher performance, for example SISO or MISO blocks.
- class pathsim.blocks.rf.sources.ChirpSource(amplitude=1, f0=1, BW=1, T=1, phase=0, sig_cum=0, sig_white=0, sampling_rate=10)[source]
Bases:
BlockChirp source, sinusoid with frequency ramp up and ramp down.
This works by using a time dependent triangle wave for the frequency and integrating it with a numerical integration engine to get a continuous phase. This phase is then used to evaluate a sinusoid.
Additionally the chirp source can have white and cumulative phase noise. Mathematically it looks like this for the contributions to the phase from the triangular wave:
\[\varphi_t(t) = \int_0^t \mathrm{tri}_{f_0, B, T}(\tau) \, d\tau\]And from the white (w) and cumulative (c) noise:
\[\varphi_n(t) = \sigma_w \, \mathrm{RNG}_w(t) + \sigma_c \int_0^t \mathrm{RNG}_c(\tau) \, d\tau\]The phase contributions are then used to evaluate a sinusoid to get the final chirp signal:
\[y(t) = A \sin(\varphi_t(t) + \varphi_n(t) + \varphi_0)\]- Parameters:
amplitude (float) – amplitude of the chirp signal
f0 (float) – start frequency of the chirp signal
BW (float) – bandwidth of the frequency ramp of the chirp signal
T (float) – period of the frequency ramp of the chirp signal
phase (float) – phase of sinusoid (initial)
sig_cum (float) – weight for cumulative phase noise contribution
sig_white (float) – weight for white phase noise contribution
sampling_rate (float) – number of samples per unit time for the internal random number generators
- reset()[source]
Reset the blocks inputs and outputs and also its internal solver, if the block has a solver instance.
- set_solver(Solver, **solver_kwargs)[source]
Initialize the numerical integration engine with local truncation error tolerance if required.
If the block already has an integration engine, it is changed, if it does not require an integration engine, this method just passes.
- sample(t)[source]
Sample from a normal distribution after successful timestep to update internal noise samples