# Aliasing in the Short time Fourier Transform of a pulse

When attempting to take the Short Time Fourier Transform of a pulse, at the end of the pulse I'm running into problems.

The signal looks like this at the end (it is a simple $sin^2$ pulse envelope, with a carrier frequency $\omega$. The only frequency that I care about in the STFT is $\omega$):

And when I perform a STFT on it using a flattop window of $6 * 2\pi/\omega$ width (and only look at the carrier frequency):

The error here for the STFT seems abnormally large towards the end. When I look at the difference between the envelope ($A * sin^2(\frac{ t * \pi }{ T} )$ where A is fitted by hand to minimize the error in the center of the pulse) and the absolute value of the STFT produced signal, I get something that looks like this:

The two lobes at the end are what the problem is. Does anyone have any sources that discuss this source of error? Properties, how to mitigate them, etc?

## migrated from scicomp.stackexchange.comDec 5 '14 at 19:11

This question came from our site for scientists using computers to solve scientific problems.

• Can you try using another window and see if you still get the lobes? – Daniel Shapero Dec 5 '14 at 0:08
• Are you doing a deconvolution with the window function before you compare it to the original function? – user7257 Dec 5 '14 at 15:06
• @DanielShapero: Other flattop windows give similar results. – Andrew Spott Dec 5 '14 at 15:07
• @user7257: I'm not sure exactly what you are talking about. Can you be more specific? – Andrew Spott Dec 5 '14 at 15:09
• What I'm assuming you are doing is overlapping FFTs with windowing. The last plot in your post is your error, comparing the reconstructed signal with the original signal, yes? If so you need to compensate for the influence of the window function first. – user7257 Dec 5 '14 at 15:14