0
$\begingroup$

How do we apply windowing of 50% (4 samples) to a discrete signal with the odd number of values as 1234567?

Is it done as: 1234 3456 567(0) or 1234 3456 67(0)(0)?

$\endgroup$
4
  • $\begingroup$ Are you referring to 50% overlap? If so your first version is correct as it maintains that overlap but your second one does not. $\endgroup$ – Dan Boschen Sep 28 '20 at 2:27
  • $\begingroup$ @DanBoschen yes talking about 50% overlap $\endgroup$ – Konzo Sep 28 '20 at 3:57
  • $\begingroup$ what would you do if the samples were 12345678? And then consider if the value for sample 8 was 0 $\endgroup$ – Dan Boschen Sep 28 '20 at 4:00
  • 1
    $\begingroup$ Yes, it would be like: 1234 3456 5678 then transform to: 1234 3456 567(0), so it's the first, thanks. $\endgroup$ – Konzo Sep 29 '20 at 23:16
2
$\begingroup$

Depending on the window function, you may be able to use a DFT-even version of the window function. "DFT-even" means that the periodic extension of the window function is symmetrical. In MATLAB and Octave you can get such a window like this (the first line in the source code):

a = hanning(10, "periodic");
b = fftshift(a);
c = a + b;
plot(a, "x", b, "o", c, "+");

enter image description here
Figure 1. DFT-even Hann window (blue x), shifted DFT-even Hann window (red o) and their sum (orange +).

The window function and the shifted window function have in some sense a 50 % overlap, and they sum to a constant, which I think was the desired quality that the 50 % overlap was though to facilitate.

Not a problem in the above, but if the window function is such that it does not end at a zero value, and the start and the end values are not equal, then one possibility would be to move one half of the value of the last sample to just before the first sample.

$\endgroup$
2
  • 1
    $\begingroup$ Nice Olli. And we should note that most higher performance windows require much more overlap to achieve this unity (75% typical). $\endgroup$ – Dan Boschen Sep 28 '20 at 18:16
  • 1
    $\begingroup$ @DanBoschen yep it depends on the window function. For window functions made of cosine terms, see this answer for the overlap that gives a constant sum. $\endgroup$ – Olli Niemitalo Sep 28 '20 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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