Time-varying spatial signals are detected by accelerometers mounted within
the patient. The signals, representative of the actual 3-D trajectory of
the patient, are compared with information representative of expected
trajectories retrieved from memory to identify a current patient posture,
which may be either a dynamic posture such as walking or running or a
change in posture such as rising from a seated position to a standing
position. In this manner, a change in posture of the patient is
identified based upon a full 3-D trajectory, rather than merely the
orientation of the patient at the beginning and the end of the change in
posture. In an example described herein, the implantable device stores
information representative of expected 3-D trajectories in the form of
pre-calculated comparison matrices derived from orthonormal kernels
employing Laguerre functions or Lagrange functions. A technique is also
described for use by an external programmer for pre-calculating
comparison matrices so as to reduce the processing burden within the
implanted device during posture detection.