pathsim.blocks.rf.sources module

pathsim.blocks.rf.sources.gaussian(t, f_max)[source]

gaussian pulse with its maximum at t=0

Parameters:
  • t (float) – evaluation time

  • f_max (float) – maximum frequency component of gaussian

Returns:

out – gaussian value

Return type:

float

pathsim.blocks.rf.sources.triangle_wave(t, f)[source]

triangle wave with amplitude ‘1’ and frequency ‘f’

Parameters:
  • t (float) – evaluation time

  • f (float) – trig wave frequency

Returns:

out – trig wave value

Return type:

float

pathsim.blocks.rf.sources.square_wave(t, f)[source]

square wave with amplitude ‘1’ and frequency ‘f’

Parameters:
  • t (float) – evaluation time

  • f (float) – square wave frequency

Returns:

out – square wave value

Return type:

float

class pathsim.blocks.rf.sources.SquareWaveSource(frequency=1, amplitude=1, phase=0)[source]

Bases: Block

Source 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:
  • frequency (float) – frequency of the square wave

  • amplitude (float) – amplitude of the square wave

  • phase (float) – phase of the square wave

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.

Parameters:

t (float) – evaluation time

Returns:

error – absolute error to previous iteration for convergence control

Return type:

float

class pathsim.blocks.rf.sources.TriangleWaveSource(frequency=1, amplitude=1, phase=0)[source]

Bases: Block

Source block that generates an analog triangle wave

Parameters:
  • frequency (float) – frequency of the triangle wave

  • amplitude (float) – amplitude of the triangle wave

  • phase (float) – phase of the triangle wave

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.

Parameters:

t (float) – evaluation time

Returns:

error – absolute error to previous iteration for convergence control

Return type:

float

class pathsim.blocks.rf.sources.SinusoidalSource(frequency=1, amplitude=1, phase=0)[source]

Bases: Block

Source block that generates a sinusoid wave

Parameters:
  • frequency (float) – frequency of the sinusoid

  • amplitude (float) – amplitude of the sinusoid

  • phase (float) – phase of the sinusoid

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.

Parameters:

t (float) – evaluation time

Returns:

error – absolute error to previous iteration for convergence control

Return type:

float

class pathsim.blocks.rf.sources.GaussianPulseSource(amplitude=1, f_max=1000.0, tau=0.0)[source]

Bases: Block

Source block that generates a gaussian pulse

Parameters:
  • amplitude (float) – amplitude of the gaussian pulse

  • f_max (float) – maximum frequency component of the gaussian pulse (steepness)

  • tau (float) – time delay of the gaussian pulse

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.

Parameters:

t (float) – evaluation time

Returns:

error – absolute error to previous iteration for convergence control

Return type:

float

class pathsim.blocks.rf.sources.StepSource(amplitude=1, tau=0.0)[source]

Bases: Block

Source block that generates a unit step

Parameters:
  • amplitude (float) – amplitude of the step / step height

  • tau (float) – time delay of the step

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.

Parameters:

t (float) – evaluation time

Returns:

error – absolute error to previous iteration for convergence control

Return type:

float

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: Block

Chirp 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.

Parameters:
  • Solver (Solver) – numerical integrator

  • solver_args (dict) – additional args for the solver

sample(t)[source]

Sample from a normal distribution after successful timestep to update internal noise samples

update(t)[source]

update the block output, assebble phase and evaluate the sinusoid

solve(t, dt)[source]

advance implicit solver of implicit integration engine, evaluate the triangle wave and cumulative noise RNG

step(t, dt)[source]

compute update step with integration engine, evaluate the triangle wave and cumulative noise RNG