A device for detecting a cardiac event is disclosed. Detection of an event is based on a test applied to a parameter whose value varies according to heart rate. Both the parameter value and heart rate (RR interval) values are filtered with an exponential average filter. The filtered parameter value and heart rate values are stored as separate datasets corresponding to particular body postures. Upper and lower boundary values and detection thresholds of the parameter are computed for each of the datasets. The test to detect the cardiac event depends on the heart rate and the difference between the parameters value and a corresponding detection threshold.