Here is the brand-new article about my DWA (Digital Waveform Archive) audio data compression algorithm. In this article, I’ll tell you why we need window functions in audio data processing and show you my C# class that implements some of the most interesting of them.

So, what are those window functions, and why do we need them? Basically, an audio window function can be any function that has 0 value at the beginning, 1 value at the half of the length of the input array of audio data samples and 0 value again at the end. Typical audio window function looks like this:

You can find some additional info about audio window functions here ->>> link.

Why do we need those functions? The reason is that if we make lossy audio data compression, we lose some amount of audio data information anyway, so we can’t perfectly reconstruct the original audio file bit by bit. Therefore, we can produce some audible noise. As we process audio data block by block, the noise sometimes is clearly audible at borders of blocks of audio data because the ending of the previous compressed audio block sometimes doesn’t perfectly fit with the beginning of the next compressed audio block. We need to find a way to eliminate this noise and to make our compressed audio wave to be smooth again without gaps.

The best way to do it is to eliminate borders of audio data blocks at all. We can do it by applying window function and making our audio data blocks to overlap with each other by 50% of its length. This way previous audio block starts to fade out after half of its length from 1 to 0 and the next audio block starts to fade in from 0 to 1 at the half of its length as shown on this picture:

The magic here is that this way we maintain constant strength of audio signal equal to 1.0 and eliminate borders of compressed audio blocks.

Well, this is all you need to know about audio windowing and window functions in digital signal processing for now. In my next article, I’ll show how it works in details. Here is my source code: