Air compressors have become critical equipment in different industrial applications such as metallurgy, mining, machinery manufacturing, petrochemical industry, transportation, etc. However, because of their complex structure and often harsh working environment, air compressors inevitably face a variety of faults and failures during their operation. Therefore, intelligent diagnostic techniques are crucially important for early fault recognition and detection to avoid industrial failure due to machine breakdowns. In this paper, an intelligent algorithm for reciprocating air compressor fault diagnosis is proposed based on several approaches, mainly: Maximal overlap discrete wavelet packet transform (MODWPT) and time domain features for feature extraction, weighted superposition attraction (WSA) for feature selection and random forest (RF), ensemble tree (ET) K-nearest neighbors (KNN) as classifiers. The proposed approach is applied to real-time acoustic signals acquired from an air compressor with one healthy and seven different faulty states. According to our approach, the data signals are decomposed by MODWPT into several nodes. Then, the time domain features are calculated for each node to construct the feature matrix for each air compressor health state. After that, WSA is applied to every matrix in the feature selection step. Finally, KNN, ET and RF are used to calculate the classification accuracy and give the confusion matrix. Compared with the robust empirical mode decomposition (REMD), the experimental results prove the effectiveness of the proposed approach to detect, identify and classify all air compressor faults.