An apparatus for encoding Modified Discrete Cosine Transform, MDCT, coefficients ( Y ( k)) of a harmonic audio signal, the apparatus comprising: means for locating spectral peaks having magnitudes exceeding a predetermined threshold, wherein the spectral peaks are located by comparing coefficients to said threshold to form a vector of peak candidates, and extracting elements from the peak candidates vector in decreasing order, wherein said threshold is calculated as θ = E ̅ p E ̅ nf γ E ̅ nf, where E p is an average peak energy, E nf is an average noise-floor energy and γ has a fixed predetermined value, and wherein a peak energy is calculated as E p ( k)= βE p ( k)+(1 -β)| Y ( k)| and a noise-floor energy is calculated as E nf ( k)= αE nf ( k)+(1- α)| Y ( k)|, wherein contribution of high-energy coefficients is emphasized in calculation of the peak energy and contribution of low-energy coefficients is emphasized in calculation of the noise-floor energy; means for encoding peak regions including and surrounding the located peaks, wherein the spectral peaks are quantized together with neighboring MDCT bins; means for encoding, using a number of reserved bits, a first low-frequency set of coefficients outside the peak regions and below a crossover frequency that depends on the number of bits used to encode the peak regions, and to encode one or more further low-frequency set of coefficients outside the peak regions if there are non-reserved bits available after encoding the peak regions; and means for encoding, using a number of reserved bits, a noise-floor gain of at least one high-frequency set of not yet encoded coefficients outside the peak regions. means for locating spectral peaks having magnitudes exceeding a predetermined threshold, wherein the spectral peaks are located by comparing coefficients to said threshold to form a vector of peak candidates, and extracting elements from the peak candidates vector in decreasing order, wherein said threshold is calculated as θ = E ̅ p E ̅ nf γ E ̅ nf, where E p is an average peak energy, E nf is an average noise-floor energy and γ has a fixed predetermined value, and wherein a peak energy is calculated as E p ( k)= βE p ( k)+(1 -β)| Y ( k)| and a noise-floor energy is calculated as E nf ( k)= αE nf ( k)+(1- α)| Y ( k)|, wherein contribution of high-energy coefficients is emphasized in calculation of the peak energy and contribution of low-energy coefficients is emphasized in calculation of the noise-floor energy; means for encoding peak regions including and surrounding the located peaks, wherein the spectral peaks are quantized together with neighboring MDCT bins; means for encoding, using a number of reserved bits, a first low-frequency set of coefficients outside the peak regions and below a crossover frequency that depends on the number of bits used to encode the peak regions, and to encode one or more further low-frequency set of coefficients outside the peak regions if there are non-reserved bits available after encoding the peak regions; and means for encoding, using a number of reserved bits, a noise-floor gain of at least one high-frequency set of not yet encoded coefficients outside the peak regions.