We propose a new synthesis method based on the genetic algorithm for the design of erbium-doped fiber amplifier gain flattening filters. Our genetic algorithm iterates starting with the long period fiber gratings structure constructed by inserting the phase-shifted long period fiber gratings in the middle of the structure, for the more accurately matched spectrum to the desired erbium-doped fiber amplifier gain flattening filter. To verify a synthesizing technique using the proposed algorithm, we have synthesized the long period fiber gratings structures according to the inverted gain spectrum of a commercially available erbium-doped fiber amplifier over the entire 1525-1570 nm range, theoretically. We have also obtained the synthesized structure was more accurate than the structure without phase-shifted section. (C) 2009 Elsevier Inc. All rights reserved.