An implantable medical device provides for improved storage of recorded
IEGMs. A sensing stage is connected to an electrode for picking up
electric potentials from inside a heart, the time course of said electric
potentials representing a heart signal, a control unit connected to said
sensing stage is adapted to process a sequence of data points that each
represent an amplitude or magnitude A of a time-varying signal at
equidistant points of time t, wherein end points of data segments are
determined by processing of the sequence of data points. The control unit
is adapted to identify end points of data segments by processing of the
sequence of data points.