Processing and learning of cardiac signals: Application to heart failure