0
$\begingroup$

I am looking for a mathematically correct way of zero-padding in the frequency domain when we have an even number of points.

(i) If we zero pad in the center of the DFT, after the Nyquist value, the result after taking the inverse is a complex number because we have disturbed the symmetry of the DFT. Taking the real part of inverse DFT, gives the upsampled data.

(ii) Alternatively, some people "zero" the Nyquist value itself when N is even (N=1,2,3,...,N) while inserting zeros in the center of the DFT. For example here at the end Link, the author mentions that is required. Once we zero the Nyquist value, after inverse DFT the output is real. Sometimes in experimental data the Nyquist value is a non-zero small number due to noise etc.

(iii) There has been some discussion here to split the Nyquist value by dividing it by two and make two half Nyquist values. I cannot find any published reference for that. Apparently that will cause phase changes.

(iv) Alternatively, suppose we wanted to add 10 zeros in the center of the DFT. In order to maintain DFT symmetry, we insert 5 zeros prior to the Nyquist value and 5 zero after the Nyquist value. In this way we do not artificially zero the Nyquist value from the experimental data. This will also give a real upsampled time domain result. However, all the references suggest adding zeros after the Nyquist value but nobody gives the detail as to how to preserve the DFT symmetry.

Which is then the mathematically correct way of upsampling an even numbered time series data by zero padding in the frequency doamin?

$\endgroup$
3
  • $\begingroup$ (i) "we have disturbed the symmetry" um, how so? That sounds incorrect, when you actually take the central (i.e. absolute-highest frequency) bins; in the even-length case you have even length over-nyquist bins, so that should work well (ii) "some people" is a bad argument for engineering ;-) I can't find your statement in the link you post, though! (iii) could you link to that discussion? It very much seems I'm missing some context! (iv) that's not "in the middle of the DFT", unless you strangely shuffle your DFT first? $\endgroup$ Commented May 31, 2022 at 8:44
  • $\begingroup$ maybe I'm misunderstanding. That can easily be avoided: Please simply introduce explicit mathematical notation for the values of your unpadded DFT, and the four different padded FFTs. Something like "My $N$-DFT is $$Y[n] = \sum_{k=0}^{N-1} y[k] e^{-j 2\pi n/N \cdot k},$$ my padded (to length of $m·N$) DFT is $$Z_{(i)}[n] = \begin{cases} Y[n]& \text{ if} n < N\\ 0 &\text{else}\end{cases}$$ or so! That avoids all misunderstanding, and also, makes it easy to answer by using your notation. $\endgroup$ Commented May 31, 2022 at 8:47
  • $\begingroup$ Ping me if you think the linked question is not a duplicate and I'll be happy to reopen. $\endgroup$
    – Peter K.
    Commented May 31, 2022 at 14:31

1 Answer 1

1
$\begingroup$

I think the question here is "what to do with the original Nyquist frequency when zero padding in the frequency domain"?

The answer is: "you shouldn't do anything since it should be zero in the first place".

Sampling without aliasing requires the signal to be bandlimited, i.e. the energy should be zero at and above the Nyquist frequency. If you have significant energy at Nyquist you have aliasing. When you zero pad, you create a very sharp transition from Nyquist to zero which is equivalent to filtering with an ideal lowpass filter, i.e. convolution with a sinc function in the time domain. Practically speaking, the time domain signal will be non-causal and very "ringy".

To put it simply: if your signal isn't properly bandlimited, zero-padding in the frequency domain doesn't work. What exactly you do with the energy at Nyquist doesn't matter. The damage is already done by having energy at Nyquist in the first placce.

$\endgroup$
2
  • $\begingroup$ Hilmar, I agree that Nyquist should be zero, but in experimental data, for example, an optical spectrum (vibrational spectrum of molecules) the Nqyuist value is small but non-zero due to measurment noise. The trick to make it zero works. $\endgroup$
    – ACR
    Commented May 31, 2022 at 20:18
  • $\begingroup$ As long as it's just residual noise, the low-passing artifacts will also just look like the same noise, so it makes no significant difference. $\endgroup$
    – Hilmar
    Commented Jun 1, 2022 at 18:33

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