de en sk
Home > Hobby Projects and Research > RKWAV - own Compressed Audio File Format

RKWAV - own Compressed Audio File Format

© Ing. Radovan Konečný - radkon, 2009-2012

Download the program:

download The compression algorithm is integrated in the program RadkonWave

About the project

RKWAV is a custom audio file format that uses lossless compression. It saves disk space and memory space, especially in my Sampler program, and in the Interactive music system INGENIA project where conventional compression methods cannot be used. Savings in storage of samples (audio recordings) improve the properties of the instrument - larger parts of samples or more samples can be stored in the computer's memory.

The RKWAV format meets the following requirements:

  • PCM format similar to WAV,
  • lossless compression,
  • extremely fast decompression and compression,
  • low computer memory requirements for both decompression and compression,
  • the possibility of a simple jump to any time-point,
  • simple saving of the decompression algorithm state to allow easy looping,
  • possibility to check the correctness of the data.

RKWAV stores only 16-bit stereo or mono audio data. The length limit is 4 giga-samples (WAV format is significantly worse - it has a 4 GB length limit).

Compression algorithm

The audio recording is divided into small sections and the most advantageous of the six compression methods is found for each section. There are 6 extremely simple compression methods, one of which is to store samples without compression. In addition, when compressing, the most advantageous size of the sections to be divided is to be sought.

One of the compression methods is based on storing the relative shift of the sample value relative to the previous one. There are places in the audio recordings where this jump is small - either quiet places or places with a low rate of high frequencies.

It's not about the smallest compressed file, but it's about saving space while maintaining an extremely simple algorithm, especially for decompression.

Additionally, a checksum (CRC) is added to the RKWAV-file so that the file can be checked for damage. Checking can also be done in the Sampler program that works with RKWAV-files.

Results and comparison

The practical use of RKWAV has shown that it is advantageous to store audio data for Sampler in this way. The sound data for the Sampler is usually a quarter to a half smaller.

If the RKWAV-file is additionally zipped, it is smaller than the zipped original WAV-file. This suggests that if a similar pre-processing of audio data were added to ZIP compression, this would significantly improve ZIP compression for audio data.

The following table shows the compression results for different types of sounds, plus in combination with ZIP compression:

Sound Compression ratio of RKWAV Compression ratio of ZIP Compression ratio of RKWAV + ZIP
piano samples (4.1 GB)
bell samples (225 MB)
harp samples (200 MB)
Modelophone samples (197 MB)
accordion samples (112 MB)
music - my first CD (as one WAV)
music - my second CD (as one WAV)
music - song Sledgehammer (49 MB)

Note: maximum compression (9) was selected for ZIP compression.

As can be seen from the table, in some cases RKWAV compression is much more efficient than ZIP compression, even though it is much less demanding for the computer.

Copyright © 2009-2024 Ing. Radovan Konečný - radkon. All rights reserved.