A new algorithm for identification from input-output measurements of a canonical form for discrete-time linear systems with disturbances having rational spectral densities is obtained by a formal application of the recursive least squares formula. Although in this case the assumptions of the least squares method are violated, the algorithm is shown to converge in mean square using a stochastic approximation proof. The proposed algorithm is computationally more expensive than the corresponding stochastic approximation formula [1], but converges much faster and there are no problems with choice of the gain constant. The complexity of the algorithm still compares favourably with other methods [2], [3], owing to its on-line structure.