I find myself in the position of having to lower the FFT resolution. Basically I have a signal of length M and I would like to make an FFT with N<M frequency bins. I cannot simply make several FFT's of length N and average them together because I need to preserve the phase of the frequency bin, since I need them for reconstructing a part of the signal. I just do not need a frequency resolution of M.

  • 1
    $\begingroup$ Why not use the DTFT? It can be implemented in five lines of code and allows you to sample at any frequencies you want. As long as M is not too large, execution speed won't be a problem on any modern computer. $\endgroup$
    – MBaz
    Commented May 3, 2022 at 14:19

1 Answer 1


As @MBaz says in the comments, just do:

M = 1024;
N = 128;
x = randn(1,M);

X = fft(x);

XX = zeros(1,N);

for k=0:(N-1)
    for t=0:(M-1)
        XX(k+1) = x(t+1)*exp(-1j*2*pi*t*k/N) + XX(k+1);

hold on;

And you get:

Example of subsampling in the frequency domain.

  • $\begingroup$ In this case, how would you calculate the inverse DTFT as it involves a continuous integral of the frequency? $\endgroup$
    – ecook
    Commented May 4, 2022 at 1:10
  • $\begingroup$ @ecook The inverse really won't have enough information to fully reconstitute the original signal. $\endgroup$
    – Peter K.
    Commented May 4, 2022 at 1:17
  • $\begingroup$ It's impossible to recover the time domain signal unless the frequency axis is densely sampled ($N>>M$ in the code)? If the frequency axis is oversampled, do we have to evaluate the IDTFT integral to find the original signal? Are there any fast methods? $\endgroup$
    – ecook
    Commented May 4, 2022 at 1:24

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.