I wanna get fft of this discrete time signal, A=ones(1,11), and I got it. I ploted the three dimensional graph of fft.
Here is the MATLAB source code.
A=ones(1,11);
N=2^10;
k=1:N;
k2=1:11;
stem(k2,A);
figure(2);
FFT_A=fft(A,N);
subplot(1,2,1);
plot(k,abs((FFT_A)))
grid on
subplot(1,2,2);
plot(k,angle((FFT_A)))
grid on
figure(3);
plot3(k,abs(FFT_A),angle(FFT_A))
% hold on
% plot3(k,abs((FFT_A).*exp(),angle((FFT_A).*exp()),'r')
grid on
axis([0 1500 -5 10 -10 10]);
xlabel('index');ylabel('abs of fft');zlabel('phase of fft');
Then, in class of signals and systems, professor said like this:
"Shift the phase of fft so that phase of the result are 0 and pi only. Plot the three dimensional graph before shifting and after shifting. Shifting means multiplying FFT_A by exp(-j*2*pi*k*n/N)."
what is the proper values of n and N? I don't know how to find it.
EDIT:
If the FFT of
x[i]
isX[k]
, then the FFT ofx[i-n]
(signal shifted byn
) isX[k]*exp(-2*pi*j*k*n/N)
, wherej
is the imaginary number andN
is the number of entries inX[k]
.