Photoplethysmography (PPG) can be carried out through facial video recording by a smart phone camera in ambient light. The main challenge is to eliminate motion artifacts and ambient noise. We describe a real-time algorithm to quantify the heart beat rate from facial video recording captured by the camera of a smart phone. We extract the green channel from the video. Then we normalize it and use a Kalman filter with a particular structure to eliminate ambient noise. This filter also enhances the heart pulse component in the signal distorted by Gaussian noise and white noise. After that we employ a band-pass FIR filter to remove the remaining motion artifacts. This is followed by peak detection or Lomb periodogram to estimate heart rate. The algorithm has low computational overhead, low delay and high robustness, making it suitable for real-time interaction on a smart phone. Finally we describe an Android application based on this study.