5
$\begingroup$

If i am not mistaken a rectangular window of length 10 gives us an array of 10x1:

1 1 1 1 1 1 1 1 1 1

And if we apply this to a signal we are left with exactly what we started with as:

x = x*1

So how does a rectangular window improve or do anything at all to our signal? What is the point of the function?

$\endgroup$

3 Answers 3

4
$\begingroup$

A rectangular window is typically used when you want to process a smaller slice out of a much larger vector of data, possibly zero-padding within a larger window (for better time locality, because a bigger FFT is too slow, doesn't fit in cache, or some other reason).

In the frequency domain, a rectangular window convolves a longer signal with a Sinc function, producing windowing artifacts that are sometimes called spectral "leakage" if the longer signal is not strictly/exactly integer periodic at the length of the window aperture.

A typical example might be that one wants to use an FFT of length 4096, zero-padded from a rectangular window of data of length 2048, in order to analyze a 43 millisecond chunk (one note? one phoneme?) out of a 48ksps audio recording that is an hour long.

$\endgroup$
1
$\begingroup$

Concerning your preliminary note: depending on the use of windows, they are sometimes normalized, for instance toward unit energy (values divided by $\left(\sum_n |w_n|^2\right)^{1/2}$) or unit sum (values divided by $\sum_n w_n$).

Here, in appearance, as you mentioned, the product by a unit amplitude window does not seem to change anything on the signal. But you are assuming here, with point-wise product:

x*1

that x and the window already have the same size. So for any processing that applies to the finite-sized x, multiplying with a unit window won't change the numerical outcomes.

However, you should take into account that:

  • the finite-sized x is already discretized, and can be trimmed from the left and the right, or set to zero outside the window, and this already affects interpretations
  • the processing on this finite-sized, discrete signal can be an approximation of some continuous processing.

Hence, interpretations or features extracted can be altered by the above considerations, from the underlying continuous time, infinite support signal. What is classically done is to consider an (infinite) signal $x = \ldots,x_0,x_1,\ldots,x_{N-1},\ldots$, unknown where the dots are, multiplied by a infinite window $w = \ldots,0,1_0,1_1,\ldots,1_{N-1},0,\ldots$, which is fully known outside the support. Hence, to analyze a potentially infinite-length signal $x$, unknown to the left and the right, it is more practical to consider that it is multiplying by an infinite window (known to be zero to the left and the right), whose properties are well-established, and whose effects on the signal can be measured.

As @hotpaw2 mentioned, such a window turns in the Fourier domain into an aliased cardinal sine, or a periodic cardinal sine.

$\endgroup$
0
$\begingroup$

In the context of windowing applying a rect window means you are not affecting the input signal.

My guess is its used as a contrast to other windowing techniques. Someone asks you: "oh what windowing are you applying before performing that fft? ". If you reply with Rectangular it means you've not conditioned the input. It would be never be used in practice as it'd just be a redundant step in your code.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.