lean(lp): fixing a bug in Q_R wave calculation