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 ​
AlphaBetaFilter- Alpha-beta tracker: position and rate estimates for a scalar measurement.AlphaBetaGammaFilter- Alpha-beta-gamma tracker: position, rate and acceleration estimates for a scalar measurement.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.DiscretePIDScheduled- Discrete-time PID controller on standard (ideal) form whose gains are input signals, intended for gain scheduling.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 functionExamples.AccumulatorGraphical- An accumulator built using block diagram components.Examples.AccumulatorSyntactic- An accumulator written using clock syntax directly.Examples.AircraftPitch- Simplified pitch-attitude dynamics of an aircraft whose aerodynamic coefficients scale with the dynamic pressure.Examples.GainScheduledPitchControl- Gain-scheduled pitch-attitude control of an aircraft during a climb with decreasing airspeed.Examples.PitchGainSchedule- Gain schedule for a pitch-attitude PID controller, with altitude and airspeed as scheduling variables.Examples.PitchReference- Square-wave reference signal for the pitch angle.Examples.SimpleLQR- State feedback of a double integrator, computed on a periodic clock.Examples.TestZeroCrossingClock- Test component that validates the ZeroCrossingClock component.ExponentialFilter- Exponential filtering (first-order filter) with input-output relation , transfer function    FIRFilter- Finite impulse response (FIR) filter with the input-output relationLatest- Move a value from one clock to another. At each tick of the clock ofy, the output is the valueMedianFilter- Median of the lastNsamples: outlier rejection.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.TrackingDifferentiator- Tracking differentiator: position and rate estimates for a scalar measurement, with a bound on the rate of change of the rate estimate.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- Zero-order hold block.
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