Atrial fibrillation (AF) is one of the most common sustained arrhythmias, affecting about 1% of the population around the world. Rapid popularization of portable and wearable devices in recent years makes widespread personalized and mobile healthcare get closer to reality than ever before. This paper presents a method aiming for automatic detection of AF from short single lead electrocardiogram (ECG) recordings. Since AF is a kind of arrhythmia being likely to alter the dynamics of heart rhythms and/or the morphological characteristics in ECG tracings, heart rate variability (HRV)-based metrics and frequency analysis are adopted as feature extractors. We validate our method on a public available data set comprised of short ECG recordings of normal rhythm (N), AF (A), and other arrhythmias (O) by support vector machine and bagging trees. For two-class classification problems (N versus A), accuracy varies from 92.0% to 96.6% under different additional noise levels. For three-class classification problem (N versus A versus O), accuracy as high as 82.0% is obtained. Experimental results suggest than even for a relatively short ECG recording, nonlinear descriptors of HRV are still efficient and robust for AF detection.