0
$\begingroup$

How does zero padding effect phase of an FFT? I thought that symmetric zero padding in the center of an image or signal produces no phase change in the FFT (See Here), but I am getting different results experimentally.

Consider I have a signal $x[n]$

$$ x = [ 1,1,1,1,1] $$

then $X = fft(x)$ $$ X = [5 ,0,0,0,0] $$

and the phase of $X$ is zero for all $n$.

If I try to symmetric zeropad in order to preserve phase I do the following:

$$ z = [1,1,1,0,0,0,1,1] $$

and $Z=fft(z)$: $$ Z = [5,2.4,-1,-0.4,1,-0.4,-1,2.4] $$

and the phase of $Z$ is

$$ \angle Z = [0 ,0,\pi,\pi,0,\pi,\pi,0] $$

Which appears that phase has not been preserved. I would expect the phase to be zero for all bins if the phase was preserved. Can someone help me understand this? Thanks!

$\endgroup$
1
  • $\begingroup$ The phase of $0+0i$ is undefined, rather than $0$. $\endgroup$
    – ZR Han
    Jun 16, 2022 at 2:39

1 Answer 1

1
$\begingroup$

Given a sequence $x[n]$, the magnitude-phase representation of its DTFT (or samples of DTFT given by an N-point DFT/FFT) has the following form:

$$ X(\omega) = |X(\omega)| e^{j\phi(\omega)} $$

where $|X(\omega)|$ is the non-negative magnitude, and $\phi(\omega)$ is the phase. When the DTFT / DFT $X(\omega)$ is real and has a negative value at some frequency $\omega$, then this must be reflected in the phase by an angle of $\phi = \pi$, since the magnitude is positive only and cannot represent negative quantities. The angle of $\phi = \pi$ effectively accounts for the negative amplitudes of the DTFT / DFT $X(\omega)$.

If you look at your DFT after zero padding, you can see the new negative valued DFT samples that didn't show up before zero padding. So for those negative valued samples, the phase angle includes a $\pi$ term to account for the sign of DTFT / DFT.

$\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.