A method for detecting a condition of a heart of a patient using an implantable medical device, including the steps of sensing acoustic signals indicative of heart sounds of the heart of the patient extracting signals corresponding to a first heart sound (S1) and a second heart sound (S2) from sensed signals calculating an energy value corresponding to a signal corresponding to the first heart sound (S1) and an energy value corresponding to the second heart sound (S2) calculating a relation between the energy value corresponding to the first heart sound and the energy value corresponding to the second heart sound for successive cardiac cycles and using at least one relation to detect the condition or a change of the condition. A medical device for determining the posture of a patient and a computer readable medium encoded with instructions are used to perform the inventive method.