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 BEFORE the timestep to 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 relative difference between the new output and the previous output (before the step) 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 BEFORE the timestep to 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 relative difference between the new output and the previous output (before the step) 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 BEFORE the timestep to 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 relative difference between the new output and the previous output (before the step) 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 BEFORE the timestep to 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 relative difference between the new output and the previous output (before the step) 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 BEFORE the timestep to 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 relative difference between the new output and the previous output (before the step) 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)[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.
- Parameters:
- 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.
- update(t)[source]
The ‘update’ method is called iteratively for all blocks BEFORE the timestep to 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 relative difference between the new output and the previous output (before the step) 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.
- solve(t, dt)[source]
The ‘solve’ method performes one iterative solution step that is required to solve the implicit update equation of the solver if an implicit solver (numerical integrator) is used.
It returns the relative difference between the new updated solution and the previous iteration of the solution to track convergence within an outer loop.
This only has to be implemented by blocks that have an internal integration engine with an implicit solver.
- step(t, dt)[source]
The ‘step’ method is used in transient simulations and performs an action (numeric integration timestep, recording data, etc.) based on the current inputs and the current internal state.
It performes one timestep for the internal states. For instant time blocks, the ‘step’ method does not has to be implemented specifically.
The method handles timestepping for dynamic blocks with internal states such as ‘Integrator’, ‘StateSpace’, etc.