# matlab padding fft changing frequencies

I'm trying to compare Matlab fft of a cosinus with two different zero padding. I thought that it wouldn't change the frequency response but when I superimpose the two curves, the frequencies are not the same. I suppose that there is something wrong with the way I do my two fft?

Fe = 8000; F = 1680; w = 2*pi*F; N = 50; P = 50; T = 1/Fe; t = (0:T:P*T); x = real(exp(i*w*t)) x_reduced = x(1:P) X = fft(x_reduced,N) N = 1000; Y = fft(x_reduced,N) plot(abs(Y)) hold on plot(abs(X),'*')

Thanks in advance

## Answers

plot((0:999)/1000*Fe,abs(Y)) hold on plot((0:49)/50*Fe,abs(X),'*')

You may need to align the frequencies of both cases.