Quantizer Block.
MJMcCann-Consulting

Rounding, or analogue-digital conversion (ADC) or discrete level outputs
MJMcCann-Consulting Logo

Quantizer Block.
This converts values into discrete levels. The underlying operation is rounding.
The input signal Av is formed as Va+aa, where Va is the output of the block at An, etc.
The input is multiplied by Bv=Vb+bb, which is the reciprocal of the desired step (discrete increment) size. The product is rounded to form the result.

If the limited output mode (1) is chosen as might apply in an ADC converter where there must be some limit to the range, the result is clipped off at the lower and upper levels defined by Cv=Vc+cc and Dv=Vd+dd
For example to chop a signal, coming in on An, in the range 0 to 5 volts into 8 levels use:
bb=1.6, cc=0.0 and dd=8.The "1.6" scales 5 to 8 and the cc and dd values clip the output.

Finally, after the clipping if any, the result is scaled by Pv=Vp+pp. The defaults are Pn is Zero and pp=1.

Quantizer Code
Procedure ActivateQ(ii:integer); //Quantizer
var Av,Bv,Cv,Dv,Pv :real;
begin with B[ii] do begin
if OnOff=0 then EXIT;
Av:=B[An].Vn+aa; Bv:=B[Bn].Vn+bb ;Pv:=B[Pn].Vn+pp;
case State of
0 : Vn:=Pv*round(Av*Bv); //no constraints
1 : begin Cv:=B[Cn].Vn+cc; Dv:=B[Dn].Vn+dd;
Vn:=round(Av*Bv);
Vn:=Pv*min(max(Vn,Cv),Dv) // bounded output
end;
end{case};
end{withBii}
end;

MJMcCann-Consulting

Help Index:
Index/Search

Background
Simulation Concepts
Continuous Systems
Discrete Systems
McSimAPN Structure
McSimAPN Operation

Using McSimAPN
Start McSimAPN
Save Model,data
Create Blocks
Run-Hold-Reset
Link Excel+VBA

PetriNet Block Types
A activity/action
B belt conveyor
C container/constant
D diverter(random)

Analogue Block Types
E exponents
F flux/flow
G function Generator
H hysteresis
I integrator
J inductor
K logic element
L logarithms
M memory
N note/label
O oscilloscope/graph
p not assigned
Q quantizer/rounding
R relay on/off
S sin/asin/atan
T timer/clock
U user link Excel
V visual voltmeter
W sWitch selector/MUX
X multiply
y not assigned
Z random (fuZZ)
& signed summation
% division/difference
@ access/move values

Invitation. McCann can help if you have a design or operational problem that needs some technical support that is outside your team's experience, some quantitative assessment of what is really the cause of the difficulties, some design alternatives or just a fresh look by an intelligent interrogator.
If you have a problem with the behaviour of a market sector, plant, process or item of equipment and would like to get a quantitative handle on it to improve yield or optimise performance, then contact us. We are always ready to give a little time to discuss a new puzzle, in confidence, of course. We'll only worry about fees when we have some defined work. We can be flexible about how we work with you.
Top
MJMcCann-Consulting,
POB 902,
Chadds Ford PA
19317 USA.
T: 1 302 654-2953
F: 1 302 429 9458
E: mjmccann@iee.org
Request. Please let us know how you found this software and your interests by sending an email to mjmccann@iee.org Thank you Date: 2012.02.26
File: q.htm