Extraction of R-Peak from Photoplethysmographic signal for diagnosis of cardiac diseases