DiscreteComponents ​
Danger
This library is a prototype and it will change quickly and substantially. We're documenting it here for reference, but please don't rely on it yet, until we finalize the interface (which will be announced on this page and via a blogpost).
This is the documentation for the DiscreteComponents library. Here you will find the documentation for the various definitions contained in DiscreteComponents.
Note that this documentation is automatically generated primarily from the doc strings and metadata associated with those definitions.
Types ​
DelayType- Selects which logical edges of anOnOffDelayblock are delayed.
Components ​
ClockPropagator- EXPERIMENTAL: a way to connect clocks of two signals but not their values.DiscreteBinaryController- Discrete-time binary (on-off) controller with hysteresis. The controller switches between two output levels based on comparing the measurement inputu_magainst theu_ssignal, with a hysteresis bandwidthbto prevent chattering.DiscreteDerivative- Discrete-time derivative filter, corresponding to the transfer functionDiscreteIntegrator- Outputsy = k * integral(u) dt, discretized according to one of three methods:DiscretePIDParallel- Discrete-time PID controller on parallel form with anti-windup and set-point weighting.DiscretePIDStandard- Discrete-time PID controller on standard (ideal) form with anti-windup and set-point weighting.DiscreteSlewRateLimiter- Discrete-time slew rate limiter that limits the rate of change of the input signal.DiscreteStateSpace- Discrete-time linear state-space system with operating point support.DiscreteTransferFunction- A discrete transfer function H(z) = B(z)/A(z).Examples.AccumulatorGraphical- An accumulator built using block diagram components.Examples.AccumulatorSyntactic- An accumulator written using clock syntax directly.Examples.TestZeroCrossingClock- Test component that validates the ZeroCrossingClock component.ExponentialFilter- Exponential filtering (first-order filter) with input-output relation , transfer function    LastValue- Gets the last defined value ofuto place ony, on the clock ofy.MovingAverageFilter- Moving average filter with input-output relation .      NDelay- A delay block that delays its input byntimesteps.NormalNoise- Generates Gaussian (normal) random noise with meanmuand standard deviationsigmaat each clock tick.OnOffDelay- On/off delay for a clocked signal.PeriodicClock- A periodic clock that ticks once everydttime units.Quantization- A quantization block that quantizes the input signal to a specified number of bits.SampleTimeSource- Outputs the time since the last sample on the clock that is connected toy.SampleWithADEffects- A sampler with additional effects that appear in practical systems, such as measurement noise and quantization.Sampler- Clock-agnostic sampler block.SuperTwistingSMC- Discrete-time super-twisting sliding mode controller.UniformNoise- Generates uniform random noise in the range[l, u]at each clock tick.UnitDelay- A unit delay that outputs the input signal delayed by one sample (z@(-1)).UnitDifference- A unit difference block that computes y[n] = u[n] - u[n-1].ZeroCrossingClock- A zero-crossing clock that ticks once every time the input signal crosses zero.ZeroOrderHold- A zero-order hold operator that maps a clocked signaluto a continuous time signaly.
Analyses ​
Examples ​
Examples.AccumulatorDemo- Test harness that samples a sine wave and accumulates it using both accumulator types.Examples.TestSlidingModeControl- Test component that validates the SuperTwistingSMC sliding mode controller.
Tests ​
Examples.Integrator.ResetValueTrackerTest- Test component that validates ResetValueTracker latches a NONZERO initialExamples.TestDiscreteIntegrator- Test component that validates the DiscreteIntegrator block with backward Euler method.Examples.TestNDelay- Test component that validates the NDelay component.Examples.TestNormalNoise- Test component that validates the NormalNoise block.Examples.TestPeriodicClock- Test component that validates the PeriodicClock component.Examples.TestSampleWithADEffects- Test component that validates the SampleWithADEffects block.Examples.TestUniformNoise- Test component that validates the UniformNoise block.Examples.TestUnitDelay- Test component that validates the UnitDelay component.Examples.TestUnitDifference- Test component that validates the UnitDifference block by computing the discrete difference of a sine wave.Examples.TestZeroOrderHold- Test that the output of a zero-order hold block resembles the integral