# Lowering Spectral Resolution of FFT

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.

• 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.
– MBaz
May 3 at 14:19

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);
end
end

plot([0:M-1]/M,abs(X));
hold on;
plot([0:N-1]/N,abs(XX),'r.')


And you get:

• In this case, how would you calculate the inverse DTFT as it involves a continuous integral of the frequency? May 4 at 1:10
• @ecook The inverse really won't have enough information to fully reconstitute the original signal.
– Peter K.
May 4 at 1:17
• 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? May 4 at 1:24