This article addresses the issue of learning efficient linear spatial filters and a classification function to match noninvasive electroencephalographic (EEG) signals to motor imagery tasks voluntarily performed by the subjects. The new perspective used in this article consists in releasing the widely accepted hypothesis stating that motor tasks-related brain activities should have similar time course across trials. This work proposes a learning model that takes into account two previously unconsidered sources of variability. First, the time course of the subject's brain activity, while performing a motor imagery task, will be considered as a trial-dependent variable. This means that the optimal time, defined as an amount of time after the trial cue, chosen to determine the task performed by the subject might be different between distinct trials. The second released hypothesis deals with the spectral discriminative brain response. Although usual learning methods do not allow any dependency between the optimal discriminative time and frequency bands, our model takes into account this possible source of variability. Therefore, the brain response in distinct frequency bands, e.g., in the mu band or beta band, could be used by the decision function at distinct instants. Based on this underlying enhanced model, we propose a two-step procedure. In the first step, the algorithm carefully analyzes, using cross-validation techniques, the training data to identify previously mentioned sources of variability. In the second step, the enhanced frequency-dependent linear spatial filters and the classification function are determined. As by-products of this analysis, substantial piece of knowledge about motor imagery is provided. First, the method allows the identification and quantification of labeling noise in brain-computer interfaces (BCIs) based on motor imagery. Second, the algorithm gives a comparative estimation of the spectral time courses during motor imagery. This article makes an extensive use of the dataset I of BCI Competition IV, which took place in 2008. It consists of a training set and a test set of 59 EEG signals recording on four subjects while performing an asynchronous BCI experiment.The two-step procedure presented in this article is shown to significantly outperform a comparative naive approach.