# STFT calculation with Gaussian Window

$$f(t)=\exp(jat^2) \,\,\, and \,\,\, g(t)\,\,is\,\, a\,\, Gaussian\,\, Window:$$

$$g(t)= \left (πσ^2\right)^{\frac{-1}{4}}\exp\left (\frac{-t^2}{2σ^2} \right ) , \,\,\,\,\,\,\left \|g(t) \right \|=1$$ 

I want to find the STFT (Short-Time-Fourier-Transform) of f(t) and prove that:



$$Psf(u,\xi)=|Sf(u,\xi)|^2=\left (\frac{4πσ^2}{1+4α^2σ^4}\right )^{\frac{1}{2}}\exp\left (\frac{-σ^2(\xi-2au)^2}{1+4a^2σ^4} \right )$$



I started by calculating the Fourier Tranformation of f(t) and found that $$f(t)=\exp(jat^2)\leftrightharpoons K \cdot \exp\left ( \frac{-ω^2}{4α}\right)=F(ω)$$

where K is a constant



I am confused with the next steps i have to follow in order to make use of F(ω) in order to calculate STFT. Do i have to use the definition of STFT?:

$$Sf(u,\xi)= \langle\,f,g_{u\xi},\rangle= \int_{-\infty}^{\infty} f(t) \cdot g(t-u) \cdot e^\left (-j \,ξ \,t \right )dt$$

I tried to do so but i didn't manage to calculate the integral above. Is there an easier way to calculate STFT by using any properties?Any help is much appreciated!Thanks in advance!

• welcome MJ13. may i ask that you turn off the boldface? This is a good question here and this is a good question at the Math SE. Meanwhile, I did a paper long ago regarding the Fourier Transforms of gaussians and linear-swept-frequency-chirps (which sorta are the same thing) Apr 9, 2019 at 19:13
• @robertbristow-johnson I turned boldface off. Thanks for responding. Can i ask the same question at the Math SE without deleting this one?
– MJ13
Apr 9, 2019 at 19:21
• sure. BTW, in $\LaTeX$, the $\exp(\cdot)$ function (and other common transcendental math functions) gets a backslash \. and there are angle brackets $\langle a, b \rangle$ for inner-product . and i would take out any oversizing. just leave the equations in their default size. Apr 9, 2019 at 19:26
• @robertbristow-johnson Thanks for the advice!I don't use Latex, so didn't know it. I am goind to ask the question at the Math SE. By the way if u have any idea about the approach of this problem it would help me a lot.
– MJ13
Apr 9, 2019 at 19:37
• take a look at my paper, MJ. it doesn't prove the initial Fourier Transform of a guassian is a guassian thing but it deals with the rest of it. Apr 9, 2019 at 19:53

so MJ, my approach to using the Gaussian window for the STFT is first to use the "ordinary frequency" definition of the continuous-time Fourier Transform:

$$\mathscr{F}\Big\{x(t)\Big\} \triangleq X(f) = \int\limits_{-\infty}^{\infty}x(t)\, e^{-j 2 \pi f t} \,\mathrm{d}t$$

$$\mathscr{F}^{-1}\Big\{X(f)\Big\} \triangleq x(t) = \int\limits_{-\infty}^{\infty}X(f)\, e^{j 2 \pi f t} \,\mathrm{d}f$$

$$\mathscr{F}\Big\{e^{-\pi t^2}\Big\} = e^{-\pi f^2}$$

and use the well known time-scaling and translation or frequency-scaling and translation theorems of the Fourier Transform to get you

$$\mathscr{F} \Big\{ e^{a t^2 + b t + c} \Big\} = e^{A f^2 + B f + C}$$

where the constants $$A$$, $$B$$, and $$C$$ can be explicitly mapped from $$a$$, $$b$$, and $$c$$. It appears to me that the mapping is:

\begin{align} A &= \frac{\pi^2}{a} \\ \\ B &= j \frac{\pi b}{a} \\ \\ C &= c - \frac{b^2}{4a} - \tfrac{1}{2}\log\left(-\frac{a}{\pi}\right) \\ \end{align}

and the inverse mapping (which should be self-similar) is:

\begin{align} a &= \frac{\pi^2}{A} \\ \\ b &= -j \frac{\pi B}{A} \\ \\ c &= C - \frac{B^2}{4A} - \tfrac{1}{2}\log\left(-\frac{A}{\pi}\right) \\ \end{align}

Looks like $$\Re\{a\}<0$$ and $$\Re\{A\}<0$$ for the integrals to converge and for the $$\log(\cdot)$$ to be real and finite in the mapping.

• Thanks for the answer! I am still a bit confused. I don't know if i get it right. Do I have to start with by calculating the continuous-time-Fourier transform of g(t) (Gaussian window) using this known isomorph and time-scaling properties of Fourier and then try to calculate the integral of STFT?
– MJ13
Apr 10, 2019 at 9:15
• the STFT is just the FT with a sliding window. a Gaussian window is good because for each frequency component, it becomes a Gaussian bump in the frequency domain with no side-lobes. look at the paper i pointed you to. if you use a Gaussian window of known width, you can derive the center frequency, the frequency sweep rate, and the amplitude ramp rate for every sinusoid in your window. with those parameters, you can manipulate the results. Apr 10, 2019 at 10:10
• Yeah i checked the paper and it helped.I am just confused with the next step I have to follow after the calculation of F(ω). Do I have to calculate F{g(t)} separately ? This whole procedure you analysed above with the fourier of the exponential exp(at^2+bt+c), where does it come from?
– MJ13
Apr 10, 2019 at 10:25
• the result above comes from completing the square with the quadratic and then using these known theorems of the Fourier Transform. Apr 10, 2019 at 10:33
• So, this whole procedure concerns the direct calculation of the STFT integral, where this exponential is appearing?
– MJ13
Apr 10, 2019 at 10:38

okay, i am gonna change the variables a little and the names of variables, to make this more consistent with bone-head electrical engineers (which is me).

my signal is

$$x(t) = e^{j \alpha t^2}$$

and my window is

$$w(t-u) = \left( \pi\sigma^2 \right)^{-1/4} \ e^{\frac{-(t-u)^2}{2\sigma^2}}$$

the product is

\begin{align} x(t)w(t-u) &= e^{j \alpha t^2} \left( \pi\sigma^2 \right)^{-1/4} \ e^{\frac{-(t-u)^2}{2\sigma^2}} \\ \\ &= \left( \pi\sigma^2 \right)^{-1/4} \ e^{j\alpha t^2} e^{\frac{-(t-u)^2}{2\sigma^2}} \\ \\ &= \left( \pi\sigma^2 \right)^{-1/4} \ e^{j\alpha t^2} e^{\frac{-t^2+2tu-u^2}{2\sigma^2}} \\ \\ &= \left( \pi\sigma^2 \right)^{-1/4} \ e^{(-1/(2\sigma^2) + j\alpha)t^2 + tu/\sigma^2 - u^2/(2\sigma^2)} \\ \\ &= e^{(-1/(2\sigma^2) + j\alpha)t^2 + tu/\sigma^2 - u^2/(2\sigma^2) - \log(\pi\sigma^2)/4} \\ \\ &= e^{a t^2 + b t + c} \\ \end{align}

so

\begin{align} a &= \frac{-1}{2\sigma^2} + j\alpha\\ \\ b &= \frac{u}{\sigma^2} \\ \\ c &= -\tfrac{1}{4}\log(\pi\sigma^2) - \frac{u^2}{2\sigma^2}\\ \end{align}

then

$$\mathscr{F} \Big\{ e^{a t^2 + b t + c} \Big\} = e^{A f^2 + B f + C}$$

and

\begin{align} A &= \frac{\pi^2}{a} \\ &= \frac{\pi^2}{\frac{-1}{2\sigma^2} + j\alpha} \\ &= \frac{-\pi^2}{\frac{1}{4\sigma^4} + \alpha^2} \left(\frac{1}{2\sigma^2} + j\alpha \right) \\ \\ B &= j \frac{\pi b}{a} \\ &= j \frac{\pi \frac{u}{\sigma^2}}{\frac{-1}{2\sigma^2} + j\alpha} \\ &= \frac{\pi u}{\alpha\sigma^2 + \tfrac{j}{2} } \\ \\ C &= c - \frac{b^2}{4a} - \tfrac{1}{2}\log\left(-\frac{a}{\pi}\right) \\ &= -\tfrac{1}{4}\log(\pi\sigma^2) - \frac{u^2}{2\sigma^2} - \frac{\left(\frac{u}{\sigma^2}\right)^2}{4(\frac{-1}{2\sigma^2} + j\alpha)} - \tfrac{1}{2}\log\left(-\frac{\frac{-1}{2\sigma^2} + j\alpha}{\pi}\right) \\ &= - \frac{u^2}{2\sigma^2} - \frac{\left(\frac{u}{\sigma^2}\right)^2}{4(\frac{-1}{2\sigma^2} + j\alpha)} - \tfrac{1}{2}\log\left(\frac{\frac{1}{2\sigma} - j\alpha\sigma}{\sqrt{\pi}}\right) \\ &= - \frac{u^2}{2\sigma^2}\left(1 - \frac{1}{1 - j2\alpha\sigma^2} \right) - \tfrac{1}{2}\log\left(\frac{\frac{1}{2\sigma} - j\alpha\sigma}{\sqrt{\pi}}\right) \\ \end{align}

simplify this to get an answer in terms of ordinary frequency $$f$$ and then substitute $$f = \frac{\xi}{2 \pi}$$ and you will have your answer in terms of angular frequency $$\xi$$.

• Now it makes more sense although I also managed to calculate it by making use of this Fourier transformation: $$\mathscr{F} \Big\{ e^{-(a-jb)t^2} \Big\} =K\cdot e^{\frac{-f^2}{4(a-jb)}}$$ Thanks a lot for the help.
– MJ13
Apr 13, 2019 at 8:29