Photonic crystals (PC) which are artificial photonic structures proposed in the 1980s, provide a promising photonic information age since the electronic information age was originated by semiconductor. The periodic structure of photonic crystals can be destroyed by defects, and the defect state with narrow frequency band that appears is the transmission peak. The influence of defects on the filtering characteristics of one-dimensional photonic crystals can provide a theoretical reference for the design of new optical filter elements. Therefore, we use the transfer matrix method to study the modulating effect of defects on the filtering performance of one-dimensional photonic crystal. The results show that photonic crystal filter performance can be affected by the number of defects and the spacing of defects. For (AB)3(CD)n(AB)3 type, where n indicates the number of defect layers, it can be found that the number of transmission peaks is equal to the number of defect layers n, and the spacing between the transmission peaks gradually decreases with the increase of n, under the condition that the appropriate refractive index is selected. And for (AB)3(CD)(AB)k(CD)(AB)3 type, where k is the number of layers in the middle (AB), the number of transmission peaks is constant but the spacing of transmission peaks decreases with increasing k and and there has been a trend towards degeneracy. The optical transmission characteristics of the defect modes in the photonic crystals have important guiding significance for the design and manufacture of new optoelectronic devices.