Asthma is a symptom of tracheal obstruction caused by bronchospasm, and it is among the most prevalent chronic obstructive pulmonary diseases. Auscultation is the most commonly used approach for the clinical diagnosis of asthma. However, recognizing wheezes through auscultation requires experienced physicians, and this approach is not sufficiently objective. Therefore, developing a method for recognizing wheezes objectively is crucial. Most studies have used the spectral features of lung sounds to detect wheezes; however, they have not achieved sufficiently high performance owing to the poor discrimination of spectral features. Several studies have attempted to extract wheezing features from lung sound spectrograms; however, their approaches were easily affected by variations in the wheezing frequency and background noise. The present study proposes a novel automatic wheeze detection algorithm for extracting lung sound features in the time-frequency domain and automatically detecting wheezes. The proposed algorithm applies canonical correlation analysis to successfully detect wheezing features in a lung sound spectrogram. Moreover, a neural network technique is used to effectively classify healthy and wheezing sounds. The experimental results indicated that the proposed algorithm showed excellent performance in detecting wheezing.