Method for encoding excitation patterns from which the masking levels for an audio signal encoding are determined following a corresponding excitation pattern decoding, wherein for said audio signal encoding said audio signal is processed successively using different window and spectral transform lengths and a section of the audio signal representing a given multiple of the longest transform length is denoted a frame, and wherein said excitation patterns are related to a spectral representation of successive sections of said audio signal, said method including the steps:
- a) forming, for a current frame of said audio signal, in each case for a corresponding group of successive excitation patterns an excitation pattern matrix P, wherein for each one of said different spectral transform lengths a corresponding excitation pattern is included in said matrix P, and taking the logarithm of each matrix P entry,
- and wherein, in case the resulting matrix size is not suited for the transform of the following step, the size of the matrix is increased by copying a necessary number of times the values of an excitation pattern located at the matrix border;
- b) applying a two-dimensional transform on the logarithmized matrix P values, resulting in matrix PT;
- c) applying a pre-determined sorting order to the coefficients in said matrix PT, said pre-determined sorting order depending on the matrix size, which matrix size depends on the number of non-longest transform lengths in the current frame and is represented by a corresponding sorting index,
- and, taking only a fixed number of values of the corresponding sorting path starting from the first value, forming a quadratic version PTq of matrix PT with these values;
- d) carrying out a SPECK encoding for matrix PTq, in which SPECK encoding bit planes of the matrix PTq are processed and a successive partitioning is used for locating and coding the positions of the corresponding coefficient bits in said bit planes.