Lets say I want to double the number of points in an array f. I had the idea to do this:

FF=[F(1:N/2) zeros(1,N) F(N/2+1:N)];

But the result is not exactly correct. Why is this?


2 Answers 2


If N is odd it's a bit simpler:


This is very close to what you had (apart from the scaling). Also note that due to numerical inaccuracies you have to take the real part of the IFFT operation. However, you should always check that the imaginary part (which you throw away) is very small (in the order of $10^{-16}$ when using double).

If N is even, you need to split the value at Nyquist:


Doing DFT based interpolation has to keep 3 principles:

  1. Keep the zeros outside the data (Looking form $ -\pi $ to $ \pi $). Namely add zeros to the higher frequencies.
  2. If it is real signal, keep the symmetry (If needed, divide the highest frequency into 2 items).
  3. Preserve the energy (By the division by 2 if needed).

By the way, the interpolation isn't by a Sinc Kernel, it is done with its discrete form - The Dirichlet Kernel.

See The Proper Way to Do Sinc Downsampling (DFT Downsampling) for Uniformly Sampled Discrete Signals with Finite Number of Samples


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.