You want to plot the magnitude and phase separately for the complex-valued data. Think of the polar form of a complex number. A few other things: you want to create a frequency vector to use in plotting the frequency domain data (DFT). You may or may not want to center 0 frequency in your Fourier transform, I do this below. Because the mean of your time data is so large, you are going to get a large 0 frequency magnitude in your Fourier transform.
value = [42007935 111212895 184546560 238219725 238219725 184546560 111212895 42007935];
time = 0:7;
stem(time,value,'markerfacecolor',[0 0 1])
title('Time Data'); xlabel('Time'); ylabel('Amplitude');
dftvalue = fft(value);
freq = -pi:(2*pi)/length(value):pi-(2*pi)/length(value);
figure;
stem(freq,abs(fftshift(dftvalue)),'markerfacecolor',[0 0 1])
title('Magnitude of DFT'); xlabel('Frequency'); ylabel('Magnitude');
figure;
stem(freq,angle(fftshift(dftvalue)),'markerfacecolor',[0 0 1])
title('Phase of DFT');
xlabel('Frequency'); ylabel('Magnitude');
Best Answer