As a promising technique, sparse coding has been widely used for the analysis, representation, compression, denoising and separation of speech. This technique needs a good dictionary which contains atoms to represent speech signals. Although many methods have been proposed to learn such a dictionary, there are still two problems. First, unimportant atoms bring a heavy computational load to sparse decomposition and reconstruction, which prevents sparse coding from real-time application. Second, in speech denoising and separation, harmful atoms have no or ignorable contributions to reducing the sparsity degree but increase the source confusion, resulting in severe distortions. To solve these two problems, we first analyze the inherent assumptions of sparse coding and show that distortion can be caused if the assumptions do not hold true. Next, we propose two methods to optimize a given dictionary by removing unimportant atoms and harmful atoms, respectively. Experiments show that the proposed methods can further improve the performance of dictionaries. (C) 2015 Elsevier B.V. All rights reserved.