# window for short time fourier transform

When we implement the 1D-short time fourier transform, the formula is as such:

$$Sf[m,l]=\sum_{n=0}^{N-1}f[n]g[n-m]\exp\left(\frac{-i2\pi l n}{N}\right).$$

the window $g$ used is normally symmetric, why is this so? (Hint: Use the phase of Short time fourier transform.

• Isn't Gabor transform a Gaussian window by definition? Any other window is just an STFT. Nov 7 '13 at 22:30
• Ok, STFT in general, but why the window must be symmetric for 1D signals? @endolith Nov 8 '13 at 0:11

You are talking about symmetry in two contexts :-

1. Gaussian
2. Window

I will talk about these two contexts one by one

Gaussian

A symmetric 2-D gaussian (I assume 1-D as in 1-D the question of symmetry does not arise) means that it does not have any directional preference (dictated by equal variances $\sigma_x$ and $\sigma_y$) . Now the job of Gabor Transform is to give us a joint time-frequency distribution (i.e telling us about frequency and phase content of a local image patch) Now consider the following two cases :-

1. Symmetric Guassian ($\sigma_x$ = $\sigma_y$) In this case the gaussian does not have any directional preference. In the above image, suppose you are centered on the central pixel and consider a patch around it which is indicated in the above image by a black rectangle in the center. Following points are important for this image :

1. Doing a Gabor Transform over that patch would yield a time-frequency representation, which involves all the pixels in the patch accordingly weighted by the symmetric gaussian.
2. All the directions at a certain distance from the origin get the same weigthage.

However, if a gaussian oriented at an angle of $135^{\circ}$, then :-

1. the white principle diagonal pixels would get almost all the weightage while the other pixels will get little weightage.
2. The time-frequency representation will be mainly a time-frequency representation around the principle diagonal.
3. If the values of $\sigma_x$ and $\sigma_y$ are sufficiently small, the gabor transform will be very very close to the time-frequency representation for the straight line which marks the principle diagonal.

Thus, for the Gaussian function,

• Symmetric gaussian is non-directional.
• Non-Symmetric gaussian is directionally oriented.
• Non-Symmetric gaussian will be useful in cases where the time-frequency analysis of a directionally oriented feature in a patch has to be carried out.

Window

The Window size basically represents the time-resolution (or space-resolution in the case of 2-D signals like images). A narrow window means that the focus on some local patch of the image is high and hence a more faithful time resolution of the Time-frequency analysis will be possible.

However, this is limited by the Heisenberg's Uncertainty principle. Although, Gabor Transform attains the theoretical lower bound for the uncertainty principle, it stays within the bounds of the principle. Thus, changing the window size is akin to changing your time resolution.

A Non-symmetrical window (like $3\times7$) is generally not chosen because generally we do not have a reason or a preference for changing our space-resolution in one direction (x or y) relative to other. In case there is a concern for the same, it can be done. However, I have never till now seen such a situation.

• Hi, thanks for your contribution. Do you have any idea what happens if for the 1D case, the window is asymmetric? Nov 10 '13 at 12:38
• In the case 1D signals, the window is also 1-D. So, as far as the window is concerned its shape cannot be asymmetric, unless you specify a center point. In the 1-D Case, the only likely case can be that the window is not symmetric with respect to the central point with respect to which the window is translated. So, In this case, as in the 2D case, one side of the sequence will have less weightage than the other side. It becomes important when analysing actuarial data, where past is known but future can only be estimated. So more weight is given to past samples and hence window is asymmetric. Nov 11 '13 at 9:54
• Ok, can you make your explanation more mathematical? Nov 11 '13 at 12:22
• No mathematics can clear this up than intuition. Read my answer in the 2-D Case and take it to the 1-D Case understanding that now the asymmetry cannot be talked about in the sense of the window size but rather simply as that point of the window which is centered at the signal point where the Time-freq. analysis is to be done. If that point is the center of the window then it is symmetric (provided symmetry is there in the window shape itself). Nov 12 '13 at 8:00
• Does the symmetry of the window speed up computations? Nov 14 '13 at 2:42