An electrode line connected to control unit, is provided with electrode which is in contact with body tissue. The electrode is extended into interior of the body or is located on surface of implantable medical device. Control unit is configured to deliver electrical stimulation impulses through electrode line only in timeframes in which no electromagnetic interferences (220) are recognized. The control unit is made to add reconstruct portion (240) to electrical measurement captured by electrode line for timeframes in which electromagnetic interferences are recognized.