Abstract A resolvent analysis framework for the axial compressor is established, and the impedance optimization is achieved based on the resolvent analysis framework for the impedance boundary condition casing treatment. This framework is derived by treating the nonlinearity in the perturbation equations as an unknown forcing, the linear relationship between wall impedance and energy gains is obtained. The validity of this framework is confirmed through experiments on rotating inlet distortion, which captures the most susceptible frequency for the stall points of the compressor. The resolvent analysis framework further confirms that the first-order circumferential mode exhibits the highest energy in the given cases. Subsequently, the proposed impedance optimization method is tested under throttling operating conditions, especially focusing on the first-order circumferential mode. The introduction of a favorable impedance boundary condition notably reduces energy gain within the low-order circumferential mode and in the range of the rotor rotating frequency, particularly in near-stall operating conditions. The energy suppression mechanism of the impedance boundary condition casing treatment is investigated, demonstrating that the impedance boundary condition, with an optimal impedance value, significantly suppresses perturbations compared to the case with the solid wall boundary condition. Lastly, a design method for the impedance boundary condition casing treatment is discussed, offering a reliable theoretical design tool for enhancing the stall margin of axial compressors.