sensors_and_interfacing

Gyroscopes measure angular rate. Integrating rate gives angle, and integrating a signal with
any bias produces angle error growing linearly with time, so a gyro alone drifts without
bound. MEMS gyros have bias stability measured in degrees per hour at best and often per
minute, so unaided attitude from a MEMS gyro is useful for seconds and useless for minutes.


sensors_and_interfacing

Inertial, Magnetic, and Position Sensing

The complementary strengths of these sensors are why they are always fused. An accelerometer
gives an absolute gravity reference that is accurate over long periods and corrupted by any
linear acceleration in the short term. A gyroscope is accurate over short periods and drifts
over long ones. A complementary filter — high-pass the gyro-integrated angle, low-pass the
accelerometer-derived angle, and sum — combines them with two lines of code and one tuning
parameter. A Kalman filter does the same optimally, additionally estimating the gyro bias,
which is what allows drift to be actively corrected rather than merely filtered.


sensors_and_interfacing

Inertial and position sensing:
  accelerometer      measures proper acceleration including gravity; noisy for
                     orientation under motion
  gyroscope          angular rate; integrates to angle with unbounded drift
  magnetometer       heading reference; corrupted by nearby ferrous material and
                     currents; requires hard- and soft-iron calibration
  IMU                accelerometer plus gyro; 9-axis adds magnetometer
  complementary filter  simple fusion; one tuning constant
  Kalman filter      optimal fusion with bias estimation
  encoder            incremental gives relative position and needs homing;
                     absolute gives position at power-on
  quadrature         two channels 90 degrees apart give direction and 4x
                     resolution
  resolver           rugged absolute angle for harsh environments
  Hall effect        magnetic field or proximity; contactless, robust
  LVDT               precise linear displacement, contactless, rugged
  time of flight     distance by light or sound propagation delay


sensors_and_interfacing

Magnetometer calibration is required rather than optional and is skipped often enough to be
worth stating explicitly. Hard-iron effects are constant magnetic offsets from permanently
magnetized material near the sensor, appearing as a displaced centre in the locus of
measurements taken while rotating the device. Soft-iron effects are distortions from
ferromagnetic material that concentrates the field, turning the ideal sphere into an
ellipsoid. Calibration consists of rotating the device through many orientations, fitting an
ellipsoid to the measurements, and deriving the offset and transformation that maps it back
to a sphere. Without this, heading error of tens of degrees is normal, and the error varies
with orientation in a way that looks like random misbehaviour.


sensors_and_interfacing

[user] My IMU-based tilt reading is stable when the robot is still but swings wildly when it
accelerates.
[assistant] tool_call imu.fusion_diagnose({"algorithm": "accel_only_tilt",
"gyro_present": true, "gyro_used": false, "accel_lp_hz": 5,
"observed_error_static_deg": 0.4, "observed_error_dynamic_deg": 22})
[tool] {"cause": "linear_acceleration_indistinguishable_from_gravity",
"fix": "complementary_or_kalman_fusion", "suggested_tau_s": 0.5,
"note": "gyro_available_but_unused"}
[assistant] The accelerometer cannot distinguish gravity from linear acceleration — both are
forces on the proof mass — so when the robot accelerates, the measured vector is the sum and
your computed tilt swings by the corresponding angle. At 0.4 degrees static error your sensor
and mounting are fine; the algorithm is the problem.


sensors_and_interfacing

You have a gyroscope and are not using it. Fuse them with a complementary filter, which is
about five lines:


sensors_and_interfacing

Integrate the gyro rate to get a short-term angle estimate. Compute the accelerometer-derived
angle as you do now. Then blend: the new estimate is alpha times (previous estimate plus gyro
rate times dt) plus (1 minus alpha) times the accelerometer angle. Alpha is derived from a
time constant tau and your sample period: alpha = tau / (tau + dt). Start with tau around 0.5
seconds.


sensors_and_interfacing

What this does physically: the gyro dominates over short intervals, where it is accurate and
the accelerometer is corrupted by motion, while the accelerometer dominates over long
intervals, where it is accurate and the gyro has drifted. Your 22 degree dynamic error should
drop to a couple of degrees.


sensors_and_interfacing

Two refinements once that works. Reject accelerometer updates when the measured magnitude
departs significantly from one g — during hard acceleration the vector is clearly not gravity,
so weight it down or skip it entirely for those samples. This is cheap and noticeably
improves behaviour under aggressive motion.


sensors_and_interfacing

Then, if you need better, move to a Kalman filter that estimates gyro bias as a state. The
complementary filter tolerates bias by continuously pulling toward the accelerometer; a
Kalman filter identifies the bias and subtracts it, so the gyro-only interval over which the
estimate stays good extends from seconds to minutes. That matters if your robot has periods of
sustained acceleration where the accelerometer is unusable throughout.


sensors_and_interfacing

Also lower your accelerometer low-pass from 5 Hz once fusion is in place — the filter was
compensating for the algorithm, and with proper fusion the extra lag costs you more than the
noise reduction gains.


sensors_and_interfacing

## Optical, Environmental, and Chemical Sensing

Photodetectors convert light to electrical signal and differ mainly in sensitivity and speed.
Photodiodes are linear, fast, and require transimpedance amplification to convert their
current output to voltage. Phototransistors provide internal gain with slower response and
poorer linearity. Avalanche photodiodes provide gain through impact ionization at high
reverse bias, useful when the signal is small, at the cost of excess noise and temperature
sensitivity. Single-photon avalanche diodes operate above breakdown and detect individual
photons with picosecond timing, which is what makes direct time-of-flight ranging possible.


sensors_and_interfacing

Optical measurement is dominated by ambient light rejection in practice. A sensor detecting
a modest signal against sunlight or fluorescent flicker must separate them, and the standard
technique is modulation: drive the source with a known carrier frequency and detect
synchronously, which rejects everything not at that frequency and in phase. This is lock-in
detection, and it can extract signals far below the noise floor. Optical filters matched to
the source wavelength, and mechanical baffling, complete the approach.


sensors_and_interfacing

Environmental and chemical sensors:
  humidity           capacitive polymer; needs temperature compensation, drifts,
                     and can be damaged by condensation
  pressure           piezoresistive or capacitive diaphragm; absolute, gauge, or
                     differential — specify which
  gas, MOX           metal oxide semiconductor; cheap, sensitive, poorly selective,
                     needs a heater and warm-up, drifts substantially
  gas, electrochemical  selective and accurate, consumable, limited lifetime
  gas, NDIR          infrared absorption; selective and stable, more expensive;
                     the right choice for CO2
  particulate        optical scattering; reports a size-binned count converted to
                     mass by an assumed density
  pH                 glass electrode; high impedance, requires frequent
                     calibration, temperature dependent
  conductivity       needs cell constant calibration and temperature compensation
  flow               differential pressure, thermal, turbine, ultrasonic, Coriolis;
                     Coriolis measures mass flow directly and is the most accurate
                     and expensive


sensors_and_interfacing

Low-cost gas sensors deserve a specific caution because their data is frequently
over-interpreted. Metal oxide sensors respond to a broad class of reducing gases with poor
selectivity, drift substantially over weeks, depend strongly on humidity and temperature, and
require significant heater power and warm-up time. They are useful for detecting changes and
trends in a controlled setting and are not calibrated instruments. Reporting a specific
concentration in parts per million from an uncalibrated metal oxide sensor implies a
precision the device cannot deliver, and comparing readings across devices or across weeks
without recalibration is not meaningful.


sensors_and_interfacing

## Calibration, Compensation, and Fusion

Calibration establishes the mapping from sensor output to physical quantity. A single-point
calibration corrects offset only. Two-point calibration corrects offset and gain and is
sufficient for a linear sensor. Multi-point calibration with interpolation or a fitted
polynomial handles nonlinearity. The calibration must span the operating range, because
extrapolating a fit beyond its data is unjustified and often badly wrong.


sensors_and_interfacing

Temperature compensation is required for nearly every precision measurement, since almost
every sensing mechanism has a temperature coefficient comparable to or larger than the effect
being measured. Compensation may be structural, as in a bridge where the effect cancels; it
may be by explicit modelling, measuring temperature alongside and applying a correction
derived from characterization; or it may be by control, holding the sensor at a fixed
temperature with a heater, which is expensive in power and effective.


sensors_and_interfacing

Calibration practice:
  single point       offset only
  two point          offset and gain; sufficient for linear sensors
  multi point        nonlinearity; interpolate or fit
  span the range     never extrapolate a calibration
  reference standard traceability matters when absolute accuracy is claimed
  temperature comp   structural, modelled, or controlled
  aging              recalibration interval established by characterization, not
                     by assumption
  per-unit vs batch  cheap sensors vary enough that per-unit calibration is often
                     needed; store coefficients in the device
  field verification a known reference check in situ, periodically


sensors_and_interfacing

Sensor fusion combines multiple sensors to produce an estimate better than any individually,
and it works when the sensors have complementary error characteristics. The general framework
is probabilistic: each sensor provides a measurement with an uncertainty, and the fused
estimate weights them inversely to their variances, so a precise sensor pulls the estimate
strongly and a noisy one barely moves it. The Kalman filter implements this recursively for
linear Gaussian systems, the extended and unscented variants handle nonlinearity, and
particle filters handle multimodal distributions where a single Gaussian is inadequate.


sensors_and_interfacing

Fault detection is the part of fusion most often omitted and most valuable in deployed
systems. When multiple sensors measure related quantities, their disagreement is
information: a residual that exceeds what the noise model predicts indicates that one of them
is wrong. With three or more redundant sensors, voting identifies which. With two, the
disagreement is detectable and not attributable, which is why safety-critical systems use
three. Implementing a residual check costs little and converts a sensor failure from silently
corrupted output into a detected fault — which is the difference between a system that
degrades gracefully and one that confidently acts on a bad reading.


test_and_manufacturing

## Design for Test

Testability is a design property, not a manufacturing activity, and a board designed without it can
be effectively untestable at any cost. The decisions that determine this are made during schematic
capture and layout, months before the first unit is built, which is why test engineering
participation early is worth far more than any amount of effort later.


test_and_manufacturing

Test points are the most basic requirement: accessible pads on every net that needs to be probed,
sized and spaced for the fixture technology, and on one side of the board where possible since
double-sided fixtures cost several times more. Nets without access can only be tested indirectly if
at all, and the common regret is a design where a fault can be detected but not localized, so a
failing board is scrapped rather than repaired.


test_and_manufacturing

Boundary scan provides access without physical probes by shifting test data through a chain of cells
at device pins, which is how dense boards with no physical access to interior nets are tested at
all. It requires the devices to support it and requires the chain to be routed and terminated
correctly, and a broken chain makes the whole facility unavailable — so its continuity is itself the
first thing a test programme checks.


test_and_manufacturing

Design for test:
  testability is designed  a board without it is untestable at any cost
  early involvement    test engineering during schematic and layout
  test points          accessible pads sized and spaced for the fixture
  single-sided access  double-sided fixtures cost several times more
  the localization requirement  detecting a fault is not enough if it cannot be
                       located
  boundary scan        test data shifted through cells at device pins
  chain integrity      a broken chain disables the whole facility
  in-circuit test access  isolating components electrically for individual
                       measurement
  built-in self test   the device testing itself and reporting; free coverage
                       where available
  test modes           firmware entry points exercising hardware directly
  the debug interface  kept accessible in production or fault analysis becomes
                       guesswork
  provisioning access  serial numbers, calibration data, and keys written during
                       test; the mechanism must exist before the first unit
  coverage analysis    which faults the test set would detect; a number worth
                       computing rather than assuming


test_and_manufacturing

Q: A production board fails functional test with a symptom that could be caused by any of six
components, and there is no way to distinguish among them. This indicates:
A. A manufacturing defect
B. A design-for-test deficiency — the test strategy can detect the fault but not localize it, so
   every failure becomes a scrapped board rather than a repaired one, and adding access at design
   time would have prevented it
C. An inadequate test program
D. Poor component quality
Reasoning: Fault localization is a property of the access the design provides and the structure of
the test set. Without measurement points between the candidate components, no test program can
distinguish them. This is the standard consequence of designing the test strategy after the layout
is complete. Answer: B.


test_and_manufacturing

## Assembly Processes

Surface mount assembly is a sequence of processes each with characteristic defects. Solder paste is
printed through a stencil onto the pads; components are placed by machine; the assembly passes
through a reflow oven whose thermal profile melts the solder and forms the joints. The great
majority of assembly defects originate in the printing step, which makes stencil design, paste
condition, and print inspection disproportionately important.


test_and_manufacturing

The reflow profile is a temperature-versus-time curve with distinct zones: preheat raising the
assembly gradually, soak allowing temperature to equalize and flux to activate, reflow above the
solder's melting point for a controlled duration, and cooling at a controlled rate. Deviations cause
specific defects — insufficient soak causes voiding and poor wetting, excessive time above melting
degrades the joint, and rapid cooling induces stress. The profile must be measured on an actual
assembly with attached thermocouples, since the oven's setpoints and the board's actual temperature
differ substantially and unpredictably with thermal mass.


test_and_manufacturing

Through-hole components are placed and soldered separately, by wave soldering or by selective
soldering or by hand, which is why a mixed-technology board costs more than its component count
suggests. Reducing the number of process steps is a real cost lever, and choosing surface-mount
alternatives for the few through-hole parts on an otherwise surface-mount board frequently saves
more than the component price difference.


test_and_manufacturing

Assembly processes:
  the sequence         print, place, reflow
  the defect origin    the majority originate in printing
  stencil design       aperture size and shape per pad; not simply the pad outline
  paste condition      temperature, age, and handling affect print quality
  print inspection     measuring deposited volume; catches defects before
                       components are placed
  placement accuracy   machine capability versus component pitch
  reflow profile       preheat, soak, reflow, cooling
  profile measurement  thermocouples on an actual assembly, not oven setpoints
  thermal mass effects  large components lag; the profile must satisfy both
                       extremes
  insufficient soak    voiding and poor wetting
  excessive reflow time  degraded joints
  tombstoning          a small component standing up when one end wets first
  the pad symmetry cause  asymmetric thermal mass at the two pads
  through-hole processes  wave, selective, or hand soldering
  the mixed-technology cost  extra process steps beyond the component price
  cleaning             required for some flux chemistries and not others; the
                       choice affects both process cost and long-term reliability


test_and_manufacturing

## Inspection and Functional Test

Inspection and test form a sequence, each catching what the previous stage cannot and each more
expensive per unit. Automated optical inspection compares the assembly against a reference image and
catches presence, orientation, and gross placement and solder defects quickly and cheaply. X-ray
inspection sees joints hidden beneath package bodies, which is the only way to inspect the
increasingly common packages with connections underneath. In-circuit test measures components
individually through the fixture. Functional test operates the board as a product.


test_and_manufacturing

The economic principle governing this sequence is that the cost of a defect rises by roughly an
order of magnitude at each stage it escapes — cheap at inspection, more at test, much more at system
assembly, and enormous in the field. This is what justifies inspection stages that seem redundant,
and it is the argument to make when inspection is proposed for removal on cost grounds.


test_and_manufacturing

Functional test verifies the board does what it is supposed to do, and its design is a real
engineering problem. It must be fast, since test time multiplies by production volume; it must be
deterministic, since intermittent test failures are indistinguishable from intermittent product
faults and destroy confidence in the whole line; and it must diagnose rather than merely pass or
fail, since a failure with no diagnostic information is a scrapped board. Test fixtures themselves
wear and drift and require their own calibration and periodic verification against known-good and
known-bad units.


test_and_manufacturing

Inspection and test:
  optical inspection   presence, orientation, gross defects; fast and cheap
  X-ray inspection     joints hidden beneath packages
  in-circuit test      components measured individually through a fixture
  functional test      the board operated as a product
  the escape cost      roughly an order of magnitude per stage
  the redundancy argument  apparently overlapping stages are economically
                       justified by that escalation
  test time            multiplied by volume; a first-order cost
  determinism          intermittent test failures destroy line confidence
  diagnostics          a pass-fail result with no information means scrap
  fixture wear         probes and contacts degrade; scheduled replacement
  fixture verification  against known-good and known-bad units
  false failure rate   the fraction of good units failing; costs yield directly
  false pass rate      the fraction of bad units passing; costs field returns
  the tuning tension   tightening limits reduces escapes and increases false
                       failures, and the correct setting depends on the relative
                       costs, which should be estimated rather than guessed
  guard banding        test limits tightened relative to specification limits by
                       the measurement uncertainty


test_and_manufacturing

## Calibration, Traceability, and Data

Any measurement in a production process is only as good as the calibration of the instrument making
it, and calibration must be traceable — linked through an unbroken chain of comparisons to a
recognized standard, each with stated uncertainty. An instrument with an expired calibration
invalidates every measurement made with it since it was last verified, which is why the calibration
schedule is enforced administratively rather than left to judgement.


test_and_manufacturing

Measurement system analysis quantifies whether a measurement process is adequate for the tolerance
it is checking. Repeatability is variation when the same operator measures the same unit
repeatedly; reproducibility is variation between operators or between instruments. Their combined
magnitude relative to the tolerance determines whether the measurement can distinguish good from
bad, and a measurement system consuming a large fraction of the tolerance produces false
acceptances and rejections regardless of how well the process itself performs.


test_and_manufacturing

Production data collection is what makes everything else improvable. Recording every measurement
against a unit serial number produces a dataset supporting yield analysis, trend detection, failure
correlation, and field return investigation. The discipline is to record measured values rather than
pass-fail results, because a value near the limit is information about a drifting process while a
pass is not, and a line that records only pass-fail cannot detect a problem until it is producing
failures.


test_and_manufacturing

Calibration and data:
  traceability         an unbroken chain to a recognized standard
  stated uncertainty   at every link in the chain
  the expiry consequence  measurements since the last verification are invalid
  administrative enforcement  schedules rather than judgement
  measurement system analysis  is the measurement adequate for the tolerance
  repeatability        same operator, same unit, repeated
  reproducibility      between operators and instruments
  the tolerance fraction  a measurement consuming much of the tolerance produces
                       false results regardless of process quality
  record values not verdicts  a value near the limit is information
  serial number association  every measurement tied to a unit
  yield analysis       what fails, where, and how often
  trend detection      drift caught before it produces failures
  statistical process control  control limits derived from the process, not from
                       the specification; the two are frequently confused and
                       they answer different questions
  the specification-control distinction  control limits describe what the process
                       does, specification limits describe what is acceptable, and
                       a process in control can still be producing out-of-
                       specification units


test_and_manufacturing

## Yield, Failure Analysis, and Ramp

Yield is the fraction of units passing at each stage, and the compound yield across a multi-stage
process is the product of the stage yields, which means that several stages at ninety-five percent
compound to something considerably worse than any of them individually suggests. Improving the worst
stage first is usually correct and requires knowing which it is, which requires the per-stage data.


test_and_manufacturing

Failure analysis determines why a unit failed, and its discipline is to establish the mechanism
rather than to find something that looks wrong. The sequence is non-destructive first — visual
inspection, electrical characterization, X-ray — then progressively destructive: decapsulation,
cross-sectioning, microscopy. Reversing this order destroys the evidence that would have identified
the cause, and the most common failure analysis error is opening the part before characterizing it
electrically.


test_and_manufacturing

Production ramp is the transition from prototype to volume, and its difficulties are consistently
underestimated. Processes that work at low volume with attentive engineers fail at volume with
operators following procedures. Components sourced in tens have different availability and variation
in tens of thousands. Yield at pilot volume is not yield at production volume. The practical
mitigations are building pilot runs on production tooling with production procedures, qualifying
alternative components before they are needed, and treating the first production run as a test of the
process rather than as a source of shippable product.


test_and_manufacturing

Yield, analysis, and ramp:
  stage yield          the fraction passing at each stage
  compound yield       the product; worse than any stage suggests
  the improvement target  the worst stage, which requires per-stage data
  first pass yield     passing without rework; the honest measure
  rework               costs more than it appears and introduces its own defects
  failure analysis     establish the mechanism, not merely find something wrong
  the sequence         non-destructive before destructive
  the common error     opening the part before characterizing it electrically
  cross-sectioning     the definitive view of a solder joint or a via
  root cause versus contributing factor  usually several factors, and stopping at
                       the first plausible one is how problems recur
  corrective action    addressing the mechanism; verification that it worked
  production ramp      prototype to volume
  the underestimation  processes working with engineers fail with operators
  pilot runs           production tooling, production procedures, production
                       operators
  second sourcing      qualified before it is needed, not during a shortage
  the first run framing  a test of the process rather than a source of shippable
                       product, which is the expectation-setting that determines
                       whether the ramp is managed or endured


thermal_management

## Heat Transfer Fundamentals

Every watt a circuit consumes becomes heat, and thermal design is the discipline of moving that heat
to the ambient environment at an acceptable temperature rise. The three mechanisms are conduction
through solids, convection to a moving fluid, and radiation as electromagnetic emission, and a real
system uses all three in proportions that shift with geometry, temperature, and airflow.


thermal_management

Conduction is governed by the material's thermal conductivity, the cross-sectional area, and the
path length, and it is the mechanism that dominates within a device and its immediate mounting. The
enormous conductivity range across materials is what makes design possible: copper conducts roughly
two thousand times better than the epoxy in a circuit board and roughly ten thousand times better
than still air, so the design problem is usually one of arranging conductive paths from the source
to a surface where the other mechanisms can take over.


thermal_management

Convection to air is where most heat finally leaves, and its coefficient depends strongly on
whether the air moves. Natural convection, driven by buoyancy alone, gives coefficients in the
range of a few watts per square metre per kelvin. Forced convection with even modest airflow gives
an order of magnitude more, which is why a fan changes a thermal design categorically rather than
incrementally. Radiation is often dismissed and should not be: at typical electronics temperatures
it can carry a comparable share to natural convection from a dark surface, and it is free.


thermal_management

Heat transfer fundamentals:
  every watt becomes heat  the starting point of any thermal budget
  conduction           through solids; conductivity times area over length
  the conductivity range  copper versus board epoxy versus air spans four orders
                       of magnitude
  convection           to a moving fluid; coefficient depends on flow
  natural convection   buoyancy driven; a few watts per square metre per kelvin
  forced convection    an order of magnitude better with modest airflow
  the fan's effect     categorical, not incremental
  radiation            proportional to the fourth power of absolute temperature
  emissivity           surface property; a dark matte surface radiates far better
                       than bare polished metal
  the radiation share  comparable to natural convection at electronics
                       temperatures; free and frequently ignored
  thermal budget       total dissipation, allowed temperature rise, ambient
                       maximum
  the ambient assumption  the specification that most often turns out to be
                       optimistic in the field


thermal_management

Q: A design that stays within temperature limits on the bench overheats when installed in its
enclosure. The primary cause is:
A. The components changed
B. The bench test had unrestricted natural convection and radiation to a cool room; the enclosure
   raises the local ambient temperature and restricts airflow, and both effects were absent from
   the test
C. Measurement error
D. Higher supply voltage
Reasoning: A board on a bench sits in an effectively infinite cool ambient with free airflow.
Inside an enclosure the internal air heats up, so the temperature difference driving convection
shrinks, and the enclosure walls block the airflow that was assumed. Thermal testing must be done
in the final mechanical configuration. Answer: B.


thermal_management

## Thermal Resistance Networks

The most useful analytical tool in practical thermal design is the resistance network analogy.
Temperature difference plays the role of voltage, heat flow the role of current, and thermal
resistance in kelvins per watt the role of electrical resistance. Series and parallel combination
rules apply directly, which means an entire thermal path can be analysed with the same intuition an
engineer already has for circuits.


thermal_management

A component's datasheet gives junction-to-case and junction-to-ambient resistances, and the
distinction matters greatly. Junction-to-ambient is measured on a specified test board under
specified conditions and rarely resembles the real installation; treating it as a property of the
part rather than of the part-plus-test-board is one of the most common thermal errors. Junction-to-
case is a property of the package and is the number to build a real network from.


thermal_management

The interface between a component and its heatsink is frequently the dominant resistance in the
chain, because two nominally flat surfaces touch at a small fraction of their apparent area and the
gaps are filled with air. Thermal interface material displaces the air with something conductive,
and the practical rules are that thinner is better, that excess material adds resistance rather than
removing it, and that mounting pressure matters as much as the material choice.


thermal_management

Resistance networks:
  the analogy          temperature as voltage, heat as current, resistance in
                       kelvins per watt
  series and parallel  combine as in circuits
  junction-to-case     a package property; the number to build a network from
  junction-to-ambient  a test-board property; not transferable to your design
  the common error     treating junction-to-ambient as intrinsic
  case-to-sink         dominated by the interface
  contact area         nominally flat surfaces touch at a small fraction of their
                       area
  thermal interface material  displaces the insulating air
  thinner is better    the material is a poorer conductor than the metals it
                       joins; it exists to fill gaps, not to conduct
  excess material      adds resistance; more is not better
  mounting pressure    as influential as material choice
  gap pads             for larger, less controlled gaps; higher resistance,
                       easier assembly
  phase change materials  conform under heat; good performance with simple
                       assembly
  spreading resistance  a small source into a large plate; the constriction near
                       the source can dominate and is missed by one-dimensional
                       analysis


thermal_management

## Board and Component Level Cooling

A printed circuit board is a thermal component, and treating it as one changes designs. Copper
planes conduct heat laterally very effectively; the board's epoxy conducts through its thickness
very poorly. The consequence is that heat spreads well within a layer and passes between layers
badly, which is why thermal vias exist — arrays of plated holes creating vertical copper paths
under a hot component.


thermal_management

Thermal via design follows a few rules that are frequently violated. Many small vias outperform few
large ones for a given copper area, because the plating thickness rather than the hole diameter
carries the heat. They should be placed directly under the thermal pad, not adjacent to it. They
should connect to a plane with substantial copper area, since a via array leading to an isolated
island accomplishes nothing. And filled or tented vias prevent solder from wicking away during
assembly, which is an assembly problem that manifests as a thermal one.


thermal_management

Component placement is the cheapest thermal lever and it is fixed early, which is why thermal
consideration must enter at the floorplanning stage rather than after routing. Hot components
spread out rather than clustered, thermally sensitive parts — voltage references, oscillators,
sensors — kept away from heat sources and from the airflow downstream of them, and orientation
chosen so that natural convection carries heat away from rather than across other components.


thermal_management

Board-level thermal design:
  the board is a thermal component  copper spreads laterally, epoxy insulates
                       vertically
  thermal vias         vertical copper paths under hot components
  many small vias      outperform few large ones for a given copper area
  placement under the pad  not adjacent
  connect to a plane   an array into an isolated island does nothing
  filled or tented     prevents solder wicking during assembly
  copper pour          area is the spreader; connected area, not drawn area
  layer stackup        an internal plane close to the component surface helps
                       most
  placement            the cheapest lever; fixed at floorplanning
  spread the heat sources  do not cluster
  protect the sensitive  references, oscillators, and sensors away from heat and
                       from downstream airflow
  orientation          natural convection rises; place accordingly
  the temperature gradient across a board  causes measurement offsets and
                       mechanical stress; both are real failure modes
  heatsinks            fin area, fin spacing matched to the flow regime, and
                       attachment method; a heatsink with fins spaced for forced
                       air performs poorly in natural convection because the
                       boundary layers merge and the inter-fin air stagnates


thermal_management

## Enclosures, Airflow, and System Level

At the system level the enclosure determines the thermal outcome more than any component choice. A
sealed enclosure must conduct all its heat through its walls to the outside surface, so its
external area and finish are the design variables, and internal fans in a sealed box move heat
around without removing any of it — though they do help by eliminating internal hot spots and
raising the effective internal convection coefficient.


thermal_management

Ventilated enclosures rely on air moving through, and the flow path must be designed rather than
assumed. Inlet low, outlet high, with the components arranged along the path in order of increasing
temperature tolerance, is the natural convection arrangement. Bypass — air finding a low-resistance
route that misses the components — is the standard failure, and blanking plates, baffles, and
sealed cable openings exist to prevent it.


thermal_management

Fan selection requires matching the fan curve to the system impedance curve. A fan rated for a
certain airflow delivers that only into free air, and the actual operating point is where its
pressure-flow curve intersects the system's resistance. A high-flow low-pressure fan performs badly
in a restricted enclosure and a smaller high-pressure fan may move more air through it, which is
counterintuitive from the specification numbers alone.


thermal_management

Enclosure and airflow:
  sealed enclosure     all heat through the walls; external area and finish are
                       the variables
  internal fan in a sealed box  removes no heat and still helps by eliminating
                       hot spots
  ventilated           designed flow path, not assumed
  inlet low, outlet high  the natural convection arrangement
  component ordering   along the flow path by increasing temperature tolerance
  bypass               air missing the components; the standard failure
  baffles and blanking  force the air where it is needed
  fan curve            pressure against flow
  system impedance     the enclosure's resistance curve
  operating point      the intersection; free-air ratings are not what you get
  the counterintuitive result  a smaller high-pressure fan can outperform a
                       larger high-flow one in a restricted box
  filters              necessary and they increase impedance as they load; design
                       for the dirty condition
  acoustic constraint  fan noise scales steeply with speed; larger and slower is
                       quieter for the same flow
  ingress protection   sealing conflicts directly with airflow; a sealed unit
                       needs a conduction path to the exterior instead
  altitude derating    less dense air convects less; a design validated at sea
                       level can fail in a data centre at elevation


thermal_management

## Measurement, Transients, and Reliability

Thermal simulation is useful for comparing options and is not a substitute for measurement, because
its results depend on boundary conditions, material properties, and interface resistances that are
rarely known to better than tens of percent. The correct workflow uses simulation to choose among
designs and measurement to validate the chosen one.


thermal_management

Measurement technique determines whether the numbers mean anything. A thermocouple attached with a
gap reads the air rather than the surface. An infrared camera reports a temperature that depends on
the assumed emissivity, so a shiny metal surface reads far too cool unless it is coated or the
emissivity is corrected. On-die temperature sensors report the junction directly and are the most
trustworthy source where available. The most useful single practice is measuring the same point by
two different methods and investigating any disagreement.


thermal_management

Transient behaviour matters when the load is not steady. Thermal capacitance means temperature lags
power, so a short burst may not raise the junction significantly while a sustained load will. The
relevant time constants span from milliseconds for a die to minutes for a heatsink to tens of
minutes for an enclosure, and a design that survives a burst profile may fail on a duty cycle whose
average power is much lower but whose on-periods exceed the shortest relevant time constant.


thermal_management

Measurement and reliability:
  simulate to compare  measure to validate
  boundary conditions  where simulation accuracy is actually lost
  thermocouple attachment  a gap reads air, not surface
  infrared emissivity  shiny metal reads far too cool; coat or correct
  on-die sensors       the most trustworthy where available
  two-method agreement  the best practical validation
  steady state         reached after several time constants; measure long enough
  thermal capacitance  temperature lags power
  time constants       milliseconds for a die, minutes for a sink, tens of
                       minutes for an enclosure
  duty cycle risk      lower average power can be worse if the on-period exceeds
                       the die time constant
  thermal throttling   the system reducing performance to stay in limits; a
                       correct behaviour that appears as a performance bug
  the Arrhenius relation  reaction rates roughly doubling per ten kelvin; the
                       basis of temperature-accelerated life testing
  electrolytic capacitor life  halves per ten kelvin; commonly the first thing to
                       fail in a hot design
  thermal cycling      fatigue at solder joints and interfaces from repeated
                       expansion mismatch; the cycle count and range matter more
                       than the peak temperature
  the design margin    validate at the worst realistic ambient with the worst
                       realistic load, and the difference between that and the
                       nominal case is where most field thermal failures live


timing_and_clocks

## Oscillators and Frequency Stability

Every digital system runs on a clock, and the clock's quality bounds what the system can do. An
oscillator's specification has several distinct parameters that are routinely confused: frequency
accuracy is how far the output is from nominal at a reference condition; frequency stability is how
much it moves with temperature, supply, load, and time; and short-term stability describes
fluctuation within a single measurement interval.


timing_and_clocks

Quartz crystals dominate because they combine good stability with low cost. Their frequency depends
on temperature along a curve set by the crystal's cut, and the standard cut for common oscillators
has a cubic characteristic that is flat near room temperature and deviates at the extremes.
Temperature compensation applies a correction from a measured temperature; oven control holds the
crystal at a fixed elevated temperature and achieves far better stability at the cost of warm-up
time and substantial power.


timing_and_clocks

Ageing is the drift that occurs regardless of conditions, from stress relief and contamination
within the package, and it is the parameter that determines how often a system must be recalibrated
or resynchronized. It is largest immediately after manufacture and decreases roughly logarithmically,
which is why a period of operation before final calibration improves long-term accuracy. Atomic
references — rubidium and caesium — remove ageing almost entirely and are used where holdover
performance without an external reference is required.


timing_and_clocks

Oscillators:
  frequency accuracy   deviation from nominal at reference conditions
  frequency stability  movement with temperature, supply, load, and time
  the confusion        accuracy and stability are different specifications
  parts per million    the usual unit; one part per million is about a second per
                       twelve days
  quartz               good stability at low cost
  the temperature curve  set by the crystal cut
  temperature compensation  correction from a measured temperature
  oven control         the crystal held at a fixed temperature; best quartz
                       stability
  the oven costs       warm-up time and substantial power
  load capacitance     the circuit's loading pulls the frequency; a mismatch is a
                       common cause of a board running slightly off nominal
  ageing               drift from stress relief and contamination
  the ageing profile   largest initially, decreasing roughly logarithmically
  burn-in              operation before calibration improves long-term accuracy
  atomic references    ageing effectively removed; used for holdover
  holdover             maintaining accuracy after losing an external reference;
                       the specification that determines what a system does when
                       its synchronization source fails


timing_and_clocks

Q: A board's oscillator runs consistently a few hundred parts per million high, though the crystal
is specified to twenty parts per million. The most likely cause is:
A. A defective crystal
B. Load capacitance mismatch — the circuit's loading pulls the crystal's frequency, and capacitors
   chosen without accounting for the crystal's specified load and the stray capacitance produce
   exactly this magnitude of offset
C. Temperature
D. Ageing
Reasoning: A crystal's frequency specification applies at a stated load capacitance. The oscillator
circuit's capacitors plus board and pin strays must present that load. A mismatch pulls the
frequency by far more than the crystal's own tolerance, and the error is consistent rather than
drifting, which distinguishes it from temperature and ageing. Answer: B.


timing_and_clocks

## Jitter, Phase Noise, and Their Effects

Jitter is the deviation of clock edges from their ideal times, and phase noise is the same
phenomenon described in the frequency domain as noise sidebands around the carrier. Which
description to use depends on the application: digital designers work with jitter in picoseconds,
and radio and data converter designers work with phase noise in decibels relative to the carrier at
specified offsets, and converting between them is routine.


timing_and_clocks

The categories of jitter matter because they have different causes and different consequences.
Random jitter arises from thermal and other noise sources, is unbounded, and is characterized by a
standard deviation. Deterministic jitter comes from identifiable mechanisms — power supply
coupling, crosstalk, and data-dependent effects in serial links — is bounded, and can be reduced by
addressing its source. Total jitter at a specified error rate combines both, and it is what a link
budget must accommodate.


timing_and_clocks

The consequences differ by application in ways worth knowing. In a synchronous digital system,
cycle-to-cycle jitter eats into the timing margin and reduces the maximum usable frequency. In a
serial link, jitter closes the eye and raises the error rate. In a sampling data converter,
aperture jitter translates directly into amplitude error proportional to the input's slew rate,
which means a high-frequency input demands a far cleaner clock than a low-frequency one for the same
resolution. In an audio converter the effect is audible distortion. The same clock can be adequate
for one of these and inadequate for another.


timing_and_clocks

Jitter and phase noise:
  jitter               edge deviation in the time domain
  phase noise          the same phenomenon as frequency-domain sidebands
  the domain choice    digital design uses jitter, radio and converters use phase
                       noise
  random jitter        thermal and other noise; unbounded, characterized by a
                       standard deviation
  deterministic jitter  identifiable mechanisms; bounded and reducible
  the sources          supply coupling, crosstalk, data-dependent effects
  total jitter         combined, specified at an error rate
  period jitter        deviation of a single period
  cycle-to-cycle jitter  the change between adjacent periods; what timing margin
                       sees
  long-term jitter     accumulated over many cycles; matters for synchronization
  timing margin        reduced by jitter, limiting maximum frequency
  eye closure          the serial link consequence
  aperture jitter      converter sampling error proportional to input slew rate
  the frequency dependence  high-frequency inputs demand far cleaner clocks
  the application specificity  a clock adequate for one role can be inadequate for
                       another in the same system


timing_and_clocks

## Clock Distribution and Phase-Locked Loops

Distributing a clock across a board or a chip introduces skew — differences in arrival time at
different destinations — and skew consumes timing margin exactly as jitter does. The distribution
network is therefore designed rather than routed: matched trace lengths, controlled impedance,
proper termination, and a topology chosen so that the paths to synchronous destinations are
equalized.


timing_and_clocks

Buffers and fanout devices regenerate the clock and add their own jitter and skew, so a deep
distribution tree accumulates both. Differential signalling is preferred for high-speed clocks
because it rejects common-mode noise and radiates less, and it costs a pair of traces and a
terminated receiver. Return paths matter as much as the traces themselves — a clock trace crossing a
gap in the reference plane has no adjacent return path, which increases inductance, degrades the
edge, and radiates.


timing_and_clocks

Phase-locked loops generate a clock locked in phase to a reference, multiplying or dividing its
frequency. The loop compares the phase of a divided output against the reference, filters the error,
and steers a controlled oscillator. The loop bandwidth is the key design parameter: it sets how fast
the loop tracks the reference and therefore which noise it passes and which it rejects. Reference
noise inside the loop bandwidth passes through; oscillator noise inside is suppressed and outside is
not. Choosing the bandwidth is therefore a decision about which noise source dominates where, and
the correct choice depends on the relative quality of the reference and the oscillator.


timing_and_clocks

Distribution and loops:
  skew                 arrival time differences; consumes margin like jitter
  matched routing      equalized path lengths to synchronous destinations
  controlled impedance  and proper termination to avoid reflections
  buffer accumulation  each stage adds jitter and skew
  differential clocks  common-mode rejection and lower emission
  return paths         a clock crossing a plane gap degrades and radiates
  the reference plane rule  never route a clock across a split in its reference
  phase-locked loop    output locked in phase to a reference
  frequency multiplication  by dividing in the feedback path
  loop bandwidth       how fast the loop tracks the reference
  reference noise      passed inside the bandwidth
  oscillator noise     suppressed inside, passed outside
  the bandwidth choice  determined by which source is cleaner where
  lock time            how long to acquire; matters for systems that switch
                       references
  jitter cleaning      a narrow-bandwidth loop with a good oscillator, used
                       specifically to remove reference jitter
  clock domain crossing  signals passing between unrelated clocks require
                       synchronizers, and the metastability failure that results
                       from omitting them is intermittent, rare, and extremely
                       difficult to diagnose


timing_and_clocks

## Time Transfer and Synchronization Protocols

Synchronizing clocks across a network is a distinct problem from generating a stable local clock,
and the fundamental obstacle is that measuring the offset between two clocks requires knowing the
one-way delay between them, which cannot be measured directly. The standard exchange measures the
round trip and assumes the path is symmetric, so any asymmetry between the forward and reverse paths
appears directly as an offset error of half the asymmetry.


timing_and_clocks

Network time protocols achieve millisecond accuracy over ordinary networks by exchanging timestamps
and filtering many measurements to reject those affected by queueing delay. Their accuracy is
limited by exactly the asymmetry problem, since queueing is not symmetric and varies. Precision time
protocols achieve sub-microsecond accuracy by timestamping in hardware at the physical layer, which
removes the software stack's variability, and by having the intermediate switches measure and report
their own residence time so that queueing is corrected rather than averaged over.


timing_and_clocks

Satellite navigation systems provide a widely available time reference with excellent accuracy,
which is why they underpin timing in telecommunications, power grids, and financial systems. This is
also a concentration risk: the signals are weak, jamming and spoofing are demonstrated, and systems
depending on them need holdover capability and ideally an independent reference. The holdover
requirement is what determines the oscillator specification, since a system that must maintain
accuracy for a day without a reference needs a fundamentally better oscillator than one that
resynchronizes every minute.


timing_and_clocks

Time transfer:
  the fundamental obstacle  one-way delay cannot be measured directly
  the round-trip exchange  measures the sum and assumes symmetry
  path asymmetry       appears as an offset of half the asymmetry
  network time protocol  milliseconds over ordinary networks
  filtering            many measurements with the queue-affected ones rejected
  precision time protocol  sub-microsecond with hardware timestamping
  hardware timestamps  removing software stack variability
  transparent clocks   switches reporting their own residence time
  boundary clocks      switches terminating and regenerating the timing chain
  satellite time       excellent accuracy and widely deployed
  the concentration risk  weak signals, demonstrated jamming and spoofing
  holdover requirement  what determines the oscillator specification
  the design question   how long must accuracy be maintained without a reference
  leap seconds         irregular one-second adjustments; a recurring source of
                       software failures because the assumption that every minute
                       has sixty seconds is embedded everywhere
  monotonic versus wall clock  code measuring elapsed time must use a monotonic
                       source, since wall clock time can move backward on
                       synchronization and every duration computed across such an
                       adjustment is wrong


timing_and_clocks

## Real-Time Scheduling and Measurement

A real-time system is one where correctness depends on timing as well as on results, and the
distinction between hard and soft real-time is about the consequence of a missed deadline rather
than about how fast the system is. A hard deadline missed is a failure; a soft deadline missed
degrades quality. Systems are frequently specified as hard when they are soft, which drives cost
without benefit, and occasionally the reverse, which is more serious.


timing_and_clocks

Schedulability analysis determines whether a set of tasks can meet their deadlines. Rate-monotonic
priority assignment gives higher priority to more frequent tasks and is optimal among fixed-priority
schemes, with a utilization bound below which schedulability is guaranteed. Earliest-deadline-first
schedules dynamically and achieves full utilization, at the cost of less predictable behaviour when
the system is overloaded. Both analyses require worst-case execution times, and obtaining them is
the hard part — measurement gives observed maxima rather than true worst cases, and static analysis
gives bounds that are safe and often very pessimistic.


timing_and_clocks

Priority inversion is the failure mode that catches designers. A high-priority task blocked on a
resource held by a low-priority task is effectively running at the low priority, and if a
medium-priority task then preempts the low-priority one, the high-priority task waits for it too.
Priority inheritance — temporarily raising the holder's priority to that of the blocked task —
resolves it, and it must be enabled explicitly on most systems that offer it.


timing_and_clocks

Real-time and measurement:
  the definition       correctness depends on timing
  hard real-time       a missed deadline is a failure
  soft real-time       a missed deadline degrades quality
  the specification error  hard requirements applied where soft would do
  rate-monotonic       higher priority to more frequent tasks; optimal for fixed
                       priority
  the utilization bound  below which schedulability is guaranteed
  earliest deadline first  dynamic; full utilization, worse overload behaviour
  worst-case execution time  required by the analysis and hard to obtain
  measurement          observed maxima, not true worst cases
  static analysis      safe bounds, often very pessimistic
  interrupt latency    the delay from event to handler; a system property
                       dominated by the longest interrupt-disabled section
  priority inversion   a high-priority task blocked behind a lower one
  priority inheritance  the holder temporarily elevated; must usually be enabled
                       explicitly
  jitter in task start  as important as latency for control loops; a control loop
                       sampling at irregular intervals has an effective noise
                       source that no filter design accounts for
  measurement method   a toggled output pin observed on a scope remains the most
                       reliable timing measurement available, because it does not
                       perturb the system the way instrumented tracing does


animation_and_motion

## Principles of Motion

Animation communicates through change over time, and the principles established by traditional
animators transfer directly to computational work because they describe perception rather than
technique. The most consequential is that motion carries meaning independent of what is moving:
the same shape moving in different ways reads as heavy or light, alive or mechanical, deliberate
or accidental.


animation_and_motion

Timing and spacing are the fundamentals. Timing is how long a motion takes, and spacing is how
the object is distributed through the intervening positions. Equal spacing reads as mechanical
because nothing physical starts and stops instantaneously; accumulating spacing at the start and
end — slow in and slow out — reads as physical because it corresponds to acceleration and
deceleration. Almost every animation that feels wrong feels wrong because of spacing rather than
because of the path.


animation_and_motion

Anticipation, follow-through, and overlapping action all derive from physical bodies having mass
and connected parts. A movement is preceded by a small opposite motion, because momentum must be
built. Parts continue past the stopping point and settle back, because they have inertia. Loosely
connected parts lag behind the driving part, arriving at different times. Applying these to
abstract objects makes them read as physical, which is why an interface element that overshoots
slightly and settles feels responsive while one that stops instantly feels brittle.


animation_and_motion

Motion principles:
  timing               how long; sets weight and urgency
  spacing              distribution through the motion; sets acceleration
  slow in and out      accumulating spacing at the ends; reads as physical
  anticipation         a small opposite motion first; prepares the viewer and
                       implies momentum
  follow-through       parts continue past the stop and settle
  overlapping action   connected parts arrive at different times
  arcs                 natural motion follows curved paths, not straight lines
  squash and stretch   deformation implying elasticity and impact; preserve volume
                       or the object reads as inflating
  secondary action     supporting motion that reinforces the primary without
                       competing
  exaggeration         readable motion is usually larger than literal
  staging              direct attention to what matters; one thing at a time
  appeal               clarity and interest in the design of the motion itself
  weight               conveyed by timing and by how motion begins and ends;
                       heavy things accelerate slowly and stop slowly


animation_and_motion

Arcs deserve emphasis because straight-line motion is the default in any keyframe system and is
almost never what physical motion looks like. A limb rotating about a joint traces an arc, a
thrown object follows a parabola, a head turning moves along a curve. Interpolating a position
linearly between two keyframes produces a straight path that reads as mechanical, and adding a
slight arc — even a small one — makes the same motion read as organic. This is the single
highest-value correction to computer-generated motion.


animation_and_motion

Q: An interface element animates from one position to another with constant velocity and feels
mechanical. The most effective single change is:
A. Make it faster
B. Apply easing so it accelerates from rest and decelerates into position
C. Add a colour change
D. Make it slower
Reasoning: Constant velocity means instantaneous acceleration at the start and stop, which does
not occur physically and which the perceptual system reads as mechanical. Easing distributes the
motion so it begins and ends gradually, matching how objects with mass move. Duration affects
urgency and does not address the underlying issue. Answer: B.


animation_and_motion

## Timing, Easing, and Interpolation

Easing functions map normalized time to normalized progress, and the choice of function is the
main expressive control in most animation systems. Linear maps time to progress directly and
reads as mechanical. Ease-out starts fast and decelerates, which suits an element entering or
responding to input because the motion begins immediately and settles gently. Ease-in starts slow
and accelerates, which suits an element leaving. Ease-in-out does both and suits motion between
two resting states.


animation_and_motion

The asymmetry between ease-in and ease-out is worth stating because it is frequently applied
backwards. An element responding to a user action should ease out — begin immediately so the
response feels instant, then decelerate into place. An element easing in appears to hesitate
before moving, which reads as latency even when the total duration is identical. This is why
interface motion overwhelmingly uses ease-out or a spring rather than symmetric easing.


animation_and_motion

Duration carries meaning and is bounded by perception. Motion below about a hundred milliseconds
is not perceived as motion, appearing instead as an instantaneous change; motion above about five
hundred milliseconds begins to feel slow in an interface context. The useful range for interface
transitions is roughly 150 to 400 milliseconds, with larger distances and larger elements
warranting longer durations because the perceived speed depends on distance covered rather than
on duration alone.


animation_and_motion

Timing and interpolation:
  linear               constant velocity; mechanical
  ease-out             fast start, gentle stop; entering, responding to input
  ease-in              gentle start, fast end; leaving
  ease-in-out          both; motion between resting states
  cubic Bezier easing  the standard parameterization; two control points define
                       the curve
  spring               physically parameterized by stiffness and damping;
                       naturally interruptible and produces overshoot when
                       underdamped
  duration bounds      below ~100 ms reads as instantaneous; above ~500 ms reads
                       as slow in an interface
  distance and duration  larger travel warrants longer duration; constant duration
                       across distances produces inconsistent perceived speed
  stagger              offset the start times of a group; reads as coordinated
                       rather than simultaneous, and directs the eye
  keyframe             a specified state at a time; interpolation fills between
  interpolation        linear, cubic, spline; the curve through the keyframes
  slerp                spherical interpolation for rotations; linear interpolation
                       of quaternions changes angular velocity and can take the
                       long path
  gimbal lock          Euler angles lose a degree of freedom at certain
                       orientations; quaternions avoid it


animation_and_motion

Rotation interpolation deserves specific mention because it fails in ways position
interpolation does not. Interpolating Euler angles independently produces motion that does not
follow the shortest rotational path and that can pass through gimbal lock, where two axes align
and a degree of freedom is lost. Quaternions represent rotation without that degeneracy, and
spherical linear interpolation between them follows the shortest arc at constant angular velocity
— which is what rotation should do and what naive interpolation does not provide.


animation_and_motion

Springs deserve mention as an alternative to duration-based easing because their properties suit
interactive motion. A spring is parameterized by stiffness and damping rather than by duration,
so the motion emerges from the physical parameters, and it is naturally interruptible — a new
target simply changes the spring's rest position and the motion continues from the current
position and velocity rather than restarting. Duration-based animation interrupted mid-flight
must either snap or blend, both of which are visible.


animation_and_motion

## Physics-Based and Procedural Motion

Physics simulation generates motion from forces and constraints rather than from specified
keyframes, which produces plausible interaction automatically and gives up direct control. It is
the right approach where the motion should respond to unpredictable conditions — a cloth
reacting to a character's movement, debris from an impact, a chain swinging — and the wrong
approach where a specific result is required, since achieving a particular outcome from a
simulation means tuning inputs indirectly.


animation_and_motion

Verlet integration is the workhorse for particle and constraint systems in creative work. It
stores positions rather than velocities, deriving velocity implicitly from the difference between
current and previous positions, which makes constraint satisfaction straightforward: move a
particle to satisfy a constraint and its velocity adjusts automatically. Cloth, rope, and soft
body simulation are built from particles with distance constraints solved iteratively, and the
iteration count trades stiffness against cost.


animation_and_motion

Procedural animation generates motion algorithmically, which scales to many elements and to
situations that cannot be authored individually. Noise-driven motion produces organic drift and
is the standard technique for idle motion, wind, and secondary sway. Flocking rules produce
coordinated group movement from three local rules — separation, alignment, and cohesion — with no
central coordination, which is the canonical demonstration that complex collective behaviour
emerges from simple local interaction.


animation_and_motion

Physics and procedural motion:
  Verlet integration   position-based; constraints are easy, velocity implicit
  constraint solving   iterate to satisfy; more iterations means stiffer
  cloth and rope       particles with distance constraints
  soft body            volume and shape constraints
  rigid body           collision detection, response, friction, and resting
                       contact; resting contact is the hard part
  collision detection  broad phase spatial partitioning, then narrow phase exact
                       tests
  restitution          bounciness; the ratio of separation to approach speed
  damping              removes energy; without it, numerical error accumulates as
                       energy gain and simulations explode
  substepping          smaller timesteps for stability; the standard fix for a
                       simulation that jitters or explodes
  noise-driven motion  organic drift, idle motion, wind
  flocking             separation, alignment, cohesion; emergent coordination
  inverse kinematics   solve joint angles to place an end effector; the basis of
                       foot placement and reaching
  forward kinematics   joint angles determine the pose; simpler and less useful
                       for targeting
  procedural walk      generate a gait from parameters; adapts to terrain in a way
                       a recorded cycle does not
  motion capture       records real motion; realistic and difficult to retarget to
                       different proportions


animation_and_motion

Inverse kinematics deserves attention because it solves the problem that makes character motion
adapt to its environment. Forward kinematics computes where a hand ends up from the joint angles,
which is straightforward and requires the animator to find angles producing the desired position
by trial. Inverse kinematics computes the joint angles placing the hand at a specified position,
which is what allows a foot to plant on uneven terrain, a hand to reach a moving target, or a
character to look at something. It is underdetermined for a chain with more joints than
constraints, so the solver needs additional preferences — a rest pose to stay near, joint limits,
and a preferred bend direction.


animation_and_motion

[user] My cloth simulation looks stiff and it explodes when the character moves quickly.
[assistant] tool_call anim.cloth_diagnose({"solver": "verlet_position_based",
"constraint_iterations": 3, "timestep": 0.0166, "substeps": 1,
"stretch_stiffness": 1.0, "damping": 0.0, "symptom": ["stiff_appearance", "instability"]})
[tool] {"issues": ["insufficient_iterations_for_stiffness_target",
"no_damping_energy_accumulates", "single_substep_at_high_velocity"],
"recommendations": {"substeps": 4, "iterations": 8, "damping": 0.02,
"stiffness_via_iterations_not_clamping": true}}
[assistant] Two separate problems that happen to have overlapping fixes.


animation_and_motion

The stiffness appearance and the instability come from the same place: with position-based
constraint solving, stiffness is a function of the iteration count rather than of a stiffness
parameter. Three iterations cannot satisfy the constraints, so the cloth stretches visibly under
load, and cranking the stiffness parameter to 1.0 with too few iterations produces overcorrection
that manifests as jitter. Raise the iteration count to around 8 and lower the per-iteration
stiffness — the cloth will be both stiffer in appearance and more stable, which sounds
contradictory and follows directly from how the solver converges.


animation_and_motion

The explosion under fast movement is a timestep problem. At one substep per frame, a fast-moving
attachment point moves a large distance in one step, which stretches constraints far beyond what
the solver can correct in one frame, and the correction overshoots. Substepping — subdividing the
frame into four smaller steps and running the full solve on each — keeps the per-step
displacement small. This costs four times the solve but is the standard and reliable fix.


animation_and_motion

Add damping. You have none, and position-based solvers accumulate energy from numerical error
because the constraint projections do work. A small global damping of one to three percent per
step removes it and is imperceptible. Without damping, a simulation left running will gain energy
indefinitely, which is why it eventually explodes even without fast motion.


animation_and_motion

Two further things worth adding once it is stable. Velocity clamping caps how fast any particle
can move in one step, which prevents a single anomalous frame from destroying the simulation and
is cheap insurance. And a maximum stretch ratio — projecting any constraint stretched beyond,
say, 10% back toward its rest length regardless of the iteration budget — prevents the visually
obvious failure where cloth stretches like rubber under load.


animation_and_motion

## Performance and Interface Motion

Animation performance is governed by what the browser or engine must do per frame, and the
distinction between properties that trigger layout and those that do not is the dominant factor
in web animation. Changing geometry — width, height, position offsets — forces the layout to be
recomputed for the element and everything affected by it, every frame. Changing transform or
opacity can be applied by the compositor to an already-rendered layer, without layout or paint,
and frequently off the main thread entirely.


animation_and_motion

The consequence is a rule with few exceptions: animate transform and opacity, and express other
effects in terms of them where possible. Moving an element uses translate rather than position
offsets. Resizing uses scale rather than width and height, accepting that scale distorts
non-uniformly scalable content such as text and borders. Where an effect genuinely requires
animating a layout property, the alternatives are the FLIP technique — measure the first and last
positions, apply an inverting transform, and animate it away — or accepting the cost for a short
transition.


animation_and_motion

Frame budget is the constraint everything must fit within. At sixty frames per second the budget
is 16.7 milliseconds per frame including everything the system does, so the application's share
is well under that. Exceeding it drops a frame, which is perceptible as a stutter, and an
animation dropping frames intermittently reads as worse than one running at a consistently lower
rate — consistency matters more than the absolute rate above a threshold.


animation_and_motion

Performance and interface motion:
  transform and opacity  compositor-only; no layout or paint
  layout-triggering     width, height, top, left; recomputed every frame
  FLIP                 first, last, invert, play; animate a transform that
                       replicates a layout change
  frame budget         16.7 ms at 60 fps, including everything
  consistency          steady frame rate matters more than peak rate
  layer promotion      will-change or a 3D transform; each layer costs memory,
                       so promoting everything is counterproductive
  requestAnimationFrame  synchronizes with the display refresh
  reduced motion       respect the user preference; vestibular disorders make
                       large motion and parallax genuinely harmful rather than
                       merely unwanted
  purpose              interface motion should communicate — where something came
                       from, what changed, what is loading; decorative motion that
                       communicates nothing costs attention
  continuity           an element moving from one position to another maintains
                       identity; appearing and disappearing does not
  duration by scale    small elements move quickly, large ones more slowly;
                       constant duration across scales looks inconsistent
  interruptibility     a user action mid-animation should redirect rather than
                       queue or snap


animation_and_motion

The purpose criterion deserves the closing emphasis because it is what separates motion that
improves an interface from motion that degrades it. Motion communicating spatial relationship —
showing that a panel came from the button that opened it, that a deleted item was removed from
this position, that a list reordered rather than replaced — helps the user build a model of the
interface and reduces the effort of following changes. Motion that merely decorates costs
attention and time on every occurrence, and its cost compounds because interface animation is
seen thousands of times by a regular user. The test worth applying is whether the motion answers a
question the user would otherwise have to work out, and if it does not, the interface is better
without it.


audio_synthesis

## Acoustics and Hearing

Sound is a pressure wave, and its perceptual attributes map onto physical ones
imperfectly enough that the mismatches drive most of audio engineering. Frequency maps
roughly to pitch, amplitude to loudness, and spectral content to timbre, but each mapping is
nonlinear and context-dependent in ways that matter practically.


audio_synthesis

Pitch perception is logarithmic. A doubling of frequency is an octave regardless of where it
occurs, so 100 to 200 Hz and 1000 to 2000 Hz are the same musical interval and vastly
different absolute spans. This is why frequency axes in audio are drawn logarithmically, why
equalizer bands are specified by centre frequency and Q rather than by absolute width, and why
a filter sweep sounds musically even only when swept exponentially.


audio_synthesis

Loudness perception is also logarithmic, which is what the decibel expresses, and it is
frequency-dependent. The equal-loudness contours show that human hearing is most sensitive
around 2 to 5 kHz — the range of speech consonants — and much less sensitive at low and very
high frequencies, with the disparity greatest at low listening levels. This is why a mix
balanced at high volume sounds bass-light when played quietly, and why checking a mix at
several levels is standard practice rather than fussiness.


audio_synthesis

Acoustic and perceptual quantities:
  audible range         nominally 20 Hz to 20 kHz; the top declines with age
  octave                a 2:1 frequency ratio
  semitone              a ratio of 2^(1/12) ≈ 1.0595 in equal temperament
  cents                 1/100 semitone; ~5 cents is the discrimination threshold
  decibel               20 log10 amplitude ratio, or 10 log10 power ratio
  +6 dB                 double the amplitude;  +10 dB is roughly twice as loud
  equal loudness        sensitivity peaks 2-5 kHz; bass needs more level to
                        sound equally loud, especially when quiet
  masking               a loud tone hides a quieter nearby one; the basis of
                        perceptual audio compression
  critical bands        the ear's effective filter widths; masking acts within them
  Haas effect           a delayed copy under ~30 ms is perceived as one sound with
                        direction from the first arrival
  speed of sound        ~343 m/s in air; ~34 cm per millisecond


audio_synthesis

Masking is the perceptual phenomenon with the most practical consequences. A loud sound
renders a quieter sound at a nearby frequency inaudible, and this is why mixes become muddy:
several instruments occupying the same frequency range mask each other, so raising the level
of one does not make it clearer, it merely masks the others more. The remedy is spectral
separation — carving space with equalization, choosing sounds that occupy different ranges,
or arranging so that competing elements do not sound simultaneously. Masking is also what
perceptual codecs exploit, discarding content that would be masked and therefore inaudible.


audio_synthesis

Q: Two sine tones are played at 220 Hz and 440 Hz. The musical interval between them is:
A. A perfect fifth   B. One octave   C. Two octaves   D. A major third
Reasoning: An octave is a frequency ratio of exactly 2:1, and 440/220 = 2. Musical intervals
correspond to frequency ratios rather than differences, which is why the same interval spans
different absolute frequency ranges at different pitches. Answer: B.


audio_synthesis

## Synthesis Methods

Subtractive synthesis begins with a harmonically rich waveform and removes content with
filters. It is the classic analog approach and remains the most intuitive, because the
mapping from control to result is direct: a sawtooth contains all harmonics with amplitude
falling as one over harmonic number, a square contains only odd harmonics, and a low-pass
filter sweeping down progressively removes the upper ones, producing the characteristic
sweeping timbre.


audio_synthesis

Additive synthesis builds sound by summing sine waves, each with its own frequency,
amplitude, and envelope. It is completely general — any sound can in principle be constructed
this way — and it is unwieldy, since a realistic timbre may need dozens of partials each with
a time-varying envelope, giving hundreds of parameters. It comes into its own for sounds with
inharmonic partials such as bells and metallic tones, where subtractive methods struggle
because the source waveforms are harmonic.


audio_synthesis

Frequency modulation synthesis modulates one oscillator's frequency with another at audio
rate, generating sidebands at sums and differences of the carrier and modulator frequencies.
Small numbers of operators produce enormously complex spectra, which is why it was
computationally attractive and why it defined a generation of digital instrument sound. Its
weakness is control: the relationship between parameters and result is not intuitive, since
changing the modulation index redistributes energy across sidebands in a way described by
Bessel functions, and the harmonicity of the result depends on the ratio of modulator to
carrier frequency — integer ratios give harmonic tones, non-integer ratios give clangorous
inharmonic ones.


audio_synthesis

Synthesis methods:
  subtractive      rich source plus filters; intuitive, the analog paradigm
  additive         sum of sines; fully general, parameter-heavy, good for
                   inharmonic timbres
  FM / phase mod   sidebands from audio-rate modulation; complex spectra cheaply,
                   unintuitive control
  wavetable        interpolate through a table of single-cycle waveforms; evolving
                   timbres with modest computation
  granular         overlapping short grains; textures, time-stretching, clouds
  physical model   simulate the mechanism — string, tube, membrane; expressive and
                   computationally expensive
  Karplus-Strong   a delay line with a filter in the feedback; plucked string from
                   almost nothing
  sample-based     recorded sources with pitch shifting and layering; realistic
                   and storage-hungry
  concatenative    assemble from a corpus of analyzed fragments; corpus-based
                   sound design
  neural           learned generative models; increasingly capable, opaque control


audio_synthesis

Physical modelling deserves attention because it produces the most expressive instruments.
Rather than reproducing a sound's spectrum, it simulates the mechanism that produces it — a
string's wave equation, a tube's air column, a membrane's modes — and the result responds to
performance gestures the way the physical instrument does. Playing harder does not simply
increase amplitude, it changes the spectrum in the way the real instrument does, because the
same nonlinearity is present in the model. The cost is computation and the difficulty of
tuning models that can become unstable or produce unphysical results.


audio_synthesis

## Filters, Envelopes, and Modulation

Filters shape the spectrum and are the primary timbral tool. A low-pass passes frequencies
below its cutoff and attenuates above, a high-pass the reverse, a band-pass a range around a
centre, and a notch rejects a narrow band. Slope, expressed in decibels per octave,
determines how sharply the transition occurs, with 12 and 24 dB per octave the common analog
designs. Resonance emphasizes frequencies near the cutoff by feeding output back to the
input, and at high settings the filter self-oscillates, becoming a sine oscillator at the
cutoff frequency.


audio_synthesis

The musical importance of resonance is that it creates a formant — a peak in the spectrum at
a fixed frequency — and formants are how the ear identifies vowel sounds and instrument
bodies. Sweeping a resonant filter produces the characteristic sound of the medium precisely
because it moves a formant, which the auditory system interprets as a change in the shape of
the resonating body rather than as a change in the source.


audio_synthesis

Envelopes control how a parameter changes over the duration of a note, and the
attack-decay-sustain-release shape is the standard. Attack time is perceptually the most
important parameter in the whole synthesizer for instrument identity: the onset transient is
what the ear uses to identify a sound source, and a recording of a piano with its attack
removed is difficult to identify. Sustain is a level rather than a time, which is the detail
that confuses newcomers, and release begins when the note is released rather than at any
fixed time.


audio_synthesis

Filters and modulation:
  low-pass          the primary timbral control; brightness
  high-pass         removes rumble and mud; often the most useful mix filter
  band-pass         isolates a range; formants and telephone effects
  notch             surgical removal; hum and resonance elimination
  slope             6, 12, 18, 24 dB/octave; steeper is more surgical
  resonance / Q     emphasis at the cutoff; self-oscillates at extremes
  ADSR              attack, decay, sustain level, release
  attack transient  the key cue for source identification
  LFO               sub-audio modulation; vibrato, tremolo, filter sweeps
  modulation matrix routing any source to any destination; where character comes
                    from
  velocity          per-note dynamic; should modulate brightness as well as level,
                    since real instruments get brighter when played harder
  keytracking       scale filter cutoff with pitch so timbre stays consistent
                    across the keyboard


audio_synthesis

The advice about velocity modulating brightness rather than only volume is worth
emphasizing because it is the single most effective change for making a synthesized
instrument sound played rather than triggered. Real instruments excited harder produce more
high-frequency content, not merely more amplitude — a hard-struck string has more upper
partials, a loudly blown reed has more harmonics. Routing velocity to filter cutoff alongside
amplitude reproduces this, and its absence is a large part of why unmodulated sample playback
sounds mechanical.


audio_synthesis

[user] My synth bass disappears on small speakers but sounds huge on my monitors.
[assistant] tool_call audio.mix_diagnose({"element": "synth_bass",
"fundamental_hz": 45, "harmonic_content_above_200hz": 0.06,
"reference_system": "8in_monitors", "target_system": "laptop_phone",
"target_lf_rolloff_hz": 180})
[tool] {"issue": "energy_below_playback_range", "audible_fraction_on_target": 0.06,
"recommended": ["harmonic_saturation", "parallel_octave_up", "reduce_sub_reliance"],
"note": "missing_fundamental_perception"}
[assistant] Your bass lives at 45 Hz with almost no harmonic content above 200 Hz, and a
laptop or phone speaker rolls off below about 180 Hz. Roughly 6% of the sound's energy is in
the range those speakers can reproduce, so the note effectively vanishes.


audio_synthesis

The fix exploits a useful property of hearing called the missing fundamental: if the
harmonics of a note are present, the ear reconstructs the pitch even when the fundamental
itself is absent. A small speaker cannot reproduce 45 Hz, and it can reproduce 90, 135, and
180 Hz, and the listener will hear the bass at its correct pitch.


audio_synthesis

Three ways to add that harmonic content, roughly in order of how natural they sound:


audio_synthesis

Saturation or soft clipping on the bass. Distortion generates harmonics at integer multiples
of the fundamental, so a modest drive adds exactly the series you need. Use a parallel or
band-limited version — saturate a high-passed copy and blend it under the clean low end — so
you keep the weight on systems that can reproduce it without making the sub-bass gritty.


audio_synthesis

A parallel octave-up layer. Duplicate the bass part an octave higher with a simple timbre and
mix it well below the main part. On big systems it sits under the fundamental and is barely
noticed; on small ones it carries the line.


audio_synthesis

Reduce the reliance on the sub range at the source. If the patch is a pure sine or a heavily
filtered saw, open the filter or change the waveform so the note has natural harmonic content
to begin with. This is usually the cleanest solution and the one to try first.


audio_synthesis

Two process notes. Check on the worst system you expect people to use, not just on
monitors — a single mono phone speaker is the standard reference for exactly this reason. And
high-pass everything else in the mix above the bass's range so it is not competing with
kick and pad energy in the same octave, which makes the bass audible without adding level.


audio_synthesis

## Sampling, Granular, and Time Manipulation

Sample-based instruments play back recordings, and their realism depends on how the
inevitable gaps are covered. Multi-sampling records the source at many pitches and dynamic
levels so that playback interpolates between close neighbours rather than stretching a single
recording far from its origin. Pitch shifting by playback rate changes duration and shifts
formants, which is why a voice pitched up sounds unnaturally small — the resonances of the
body scaled with the pitch, which does not happen when a real singer sings higher. Formant
preservation corrects this by separating the spectral envelope from the excitation and
shifting only the latter.


audio_synthesis

Granular synthesis decomposes audio into short grains, typically 10 to 100 milliseconds, and
reassembles them with independent control of position, density, pitch, and envelope. Its
power is that time and pitch become independent: grains can be read from a fixed position
while playback continues, freezing a sound indefinitely, or advanced at any rate relative to
their pitch. Grain size determines character — very short grains produce a pitched buzz at
the grain rate, medium grains produce texture, long grains preserve recognizable fragments.


audio_synthesis

Time and pitch manipulation:
  playback rate       changes pitch and duration together; the tape paradigm
  granular            independent time and pitch; textural artifacts at extremes
  phase vocoder       STFT-based; excellent for tonal material, smears transients
  transient-aware     detect and preserve onsets, stretch only between them
  formant preserve    keep the spectral envelope fixed when shifting pitch
  loop points         must match in phase and amplitude or produce a click
  crossfade loops     the practical fix for imperfect loop points
  round robin         alternate among several recordings of the same note to avoid
                      the machine-gun effect of identical repeats
  velocity layers     separate recordings per dynamic level; the main cost of
                      realistic sample libraries


audio_synthesis

The machine-gun effect is worth naming because the fix is simple and the problem is
pervasive. Repeated identical samples are immediately recognizable as artificial, because no
real performer produces two identical notes. Round robin cycling among several recordings,
combined with small randomizations of pitch, timing, and level, removes the artifact almost
entirely. The randomization amounts are small — a few cents, a few milliseconds, a decibel —
and their absence is more audible than their presence.


audio_synthesis

## Composition, Space, and Practice

Algorithmic composition generates musical material by rule. The approaches parallel those in
visual generative work: grammars that rewrite musical phrases, Markov chains that model
transition probabilities between pitches or chords, constraint systems that enforce voice
leading rules, cellular automata mapped to pitch and rhythm, and generative models trained on
corpora. The perennial difficulty is long-range structure: local rules produce plausible
phrases and rarely produce a piece with direction, because musical form operates over minutes
and local rules see only seconds.


audio_synthesis

Hierarchical approaches address this by generating structure first — form, key areas,
dynamic arc — and filling in detail within that scaffold, which is how human composers
typically work and which reliably produces more coherent results than generating note by
note. The same principle appears throughout generative work: decide global structure
explicitly rather than hoping it emerges from local rules.


audio_synthesis

Spatial audio places sound in three dimensions, and the cues the auditory system uses are
well characterized. Interaural time difference dominates below about 1.5 kHz, since the
wavelength exceeds the head's width and phase comparison is unambiguous. Interaural level
difference dominates above, where the head shadows the far ear. Spectral cues from the outer
ear's shape resolve elevation and front-back ambiguity, and these are individual, which is why
generic head-related transfer functions localize imperfectly and personalized ones work
markedly better.


audio_synthesis

Spatial and production practice:
  panning              amplitude difference between channels; a simple ILD cue
  binaural / HRTF      filter with head-related transfer functions; convincing over
                       headphones, individual variation limits generic sets
  ambisonics           a channel-agnostic spherical harmonic representation;
                       decodable to any speaker layout, rotatable for head tracking
  reverberation        early reflections convey room size and distance; the tail
                       conveys space
  pre-delay            gap before reverb; separates source from space and preserves
                       clarity
  distance cues        level, high-frequency loss, and the ratio of direct to
                       reverberant sound; the ratio is the strongest cue
  gain staging         keep levels healthy through the chain; in floating point,
                       headroom is cheap and clipping is still permanent
  dynamic range        compression controls it; over-compression removes the
                       contrast that makes loud passages feel loud
  reference tracks     compare against known material on the same system
  mono compatibility   check; phase-cancelling stereo effects can vanish


audio_synthesis

The direct-to-reverberant ratio deserves the last word because it is the strongest distance
cue and the most commonly mishandled. A sound close to the listener is mostly direct with
little room; a distant sound is mostly reflected. Changing the level of a source without
changing this ratio makes it louder or quieter rather than nearer or farther, which is why
simply turning something down does not push it back in a mix. Increasing the reverb send
while reducing the direct level moves a source convincingly into the distance, and doing the
opposite brings it forward, and this pair of controls does more for depth than any amount of
equalization.


color_and_design_theory

## Colour Perception and Spaces

Colour is a perceptual construction rather than a property of light. The retina contains
three cone types with broad overlapping sensitivities, and colour is the brain's
interpretation of their relative responses — which is why entirely different spectra can look
identical, a phenomenon called metamerism. Two paint samples matching under daylight can
differ visibly under incandescent light, because their spectra differ while their cone
responses happened to coincide under one illuminant. This is a practical problem in printing,
manufacturing, and any situation where colours are matched under one condition and viewed
under another.


color_and_design_theory

Colour constancy is the perceptual system's compensation for illumination. A white sheet
looks white in warm indoor light and in blue shade despite reflecting very different spectra,
because the visual system estimates the illuminant and discounts it. The compensation is
imperfect and context-dependent, which is why identical pixel values can appear as different
colours depending on surrounding content, and why simultaneous contrast effects are so
robust: a grey patch appears lighter against dark surroundings and darker against light ones.


color_and_design_theory

Colour spaces organize colour numerically, and choosing the wrong one for a task is the most
common source of poor colour work. RGB is device-oriented and additive, matching how displays
emit light. CMYK is subtractive and matches how ink absorbs it, which is why the two gamuts
differ and why saturated RGB colours cannot be printed. HSL and HSV are convenient
reparameterizations of RGB and are not perceptually uniform: their lightness axis does not
correspond to perceived brightness, so a fully saturated yellow and a fully saturated blue at
the same nominal lightness differ enormously in how bright they look.


color_and_design_theory

Colour spaces and their proper use:
  RGB             additive, device-dependent; capture and display
  sRGB            the standard consumer space; gamma-encoded, limited gamut
  Display P3      wider gamut, now common on modern screens
  CMYK            subtractive; print, with a smaller and differently shaped gamut
  HSL / HSV       intuitive parameterization of RGB; not perceptually uniform
  CIELAB          designed for perceptual uniformity; the classical choice for
                  colour difference
  OKLab / OKLCH   modern perceptually uniform space; better hue linearity than
                  Lab, and interpolation in it produces predictable gradients
  linear RGB      proportional to light; required for any arithmetic on colour
  gamut           the representable range; conversion requires mapping
                  out-of-gamut colours, which is a lossy decision
  white point     the reference for what counts as neutral; D65 is standard
  delta E         perceptual colour difference; below about 1 is imperceptible