An encoder comprising: a synthesizer configured to generate a synthesized high band audio signal based on a high band audio signal; gain shape circuitry configured to: determine a number of sub-frames of multiple sub-frames that are saturated, the multiple sub-frames included in a frame of the high band audio signal; apply a first scaling factor to scale the high band audio signal if the particular sub-frame is saturated to generate a first scaled high band audio signal; determine a gain shape parameter of the particular sub-frame based on a first ratio associated with the first scaled high band audio signal and the synthesized high band audio signal; a gain shape compensator configured to generate a compensated synthesized high band audio signal based on the synthesized high band audio signal and based on the gain shape parameter; gain frame circuitry configured to: apply a second scaling factor to scale the high band audio signal to generate a second scaled high band audio signal based on the number of sub-frames that are saturated; determine a gain frame parameter corresponding to the frame based on the number of sub-frames that are saturated and based on a second ratio associated with the second scaled high band audio signal and the compensated synthesized high band audio signal. gain shape circuitry configured to: determine a number of sub-frames of multiple sub-frames that are saturated, the multiple sub-frames included in a frame of the high band audio signal; apply a first scaling factor to scale the high band audio signal if the particular sub-frame is saturated to generate a first scaled high band audio signal; determine a gain shape parameter of the particular sub-frame based on a first ratio associated with the first scaled high band audio signal and the synthesized high band audio signal; determine a number of sub-frames of multiple sub-frames that are saturated, the multiple sub-frames included in a frame of the high band audio signal; apply a first scaling factor to scale the high band audio signal if the particular sub-frame is saturated to generate a first scaled high band audio signal; determine a gain shape parameter of the particular sub-frame based on a first ratio associated with the first scaled high band audio signal and the synthesized high band audio signal; a gain shape compensator configured to generate a compensated synthesized high band audio signal based on the synthesized high band audio signal and based on the gain shape parameter; gain frame circuitry configured to: apply a second scaling factor to scale the high band audio signal to generate a second scaled high band audio signal based on the number of sub-frames that are saturated; determine a gain frame parameter corresponding to the frame based on the number of sub-frames that are saturated and based on a second ratio associated with the second scaled high band audio signal and the compensated synthesized high band audio signal. apply a second scaling factor to scale the high band audio signal to generate a second scaled high band audio signal based on the number of sub-frames that are saturated; determine a gain frame parameter corresponding to the frame based on the number of sub-frames that are saturated and based on a second ratio associated with the second scaled high band audio signal and the compensated synthesized high band audio signal.