We study the physics of a free-electron laser based on a "two-frequency" undulator (TFU) which induces large nonlinear effects, especially on the spectral dynamics. These effects are analyzed in an extended formalism where the spontaneous emission, the low-gain regime, and the strong-field saturation regime are studied. Numerical simulations show that an optimized TFU generates a laser field having both a large extraction efficiency and a narrow spectrum.