In a communications system, input digital samples are continuously stored into a buffer and successively divided into a group of blocks of different lengths. The samples of each of the blocks are encoded into linear transform coefficients at intervals corresponding to the length of each block and each block of the linear transform coefficients is then decoded into a variable length block of decoded samples. An error between each block of decoded samples and a corresponding block of samples from the buffer is detected, and a plurality of such errors derived from each group of blocks of input samples are stored in memory. A minimum value of the errors in the memory is determined and one of the blocks of the coded symbols which corresponds to the minimum value is identified as having an optimum block length. The linear transform coefficients of the optimum block length are multiplexed with the optimum block length information into a channel for transmission. At the receive end of the system, the transmitted linear transform coefficients are decoded into original signal at intervals corresponding to the multiplexed optimum block length information.