Hi Mohamed
if the time vector does not have a small enough step the output will show a shifted frequency, or not even show any frequency at all. Try the following
f=1000;
amp_signal=1;
t=[0:1/(2*f):1];
just on 2 samples per cycle, and it's not clear what is the input. Don't work on the edge, try to get as many samples as reasonably possible per cycle.
.
Using 4 samples per cycle
.
t=[0:1/(4*f):.5];
.
and here you have the input tone.
Bear in mind that it would make sense to plot amplitude and phase, or real in imaginary, just plugging the complex fft into plot is not the way to proceed, choose what you want to plot.
if you find this answer useful would you please be so kind to consider marking my answer as Accepted Answer?
To any other reader, if you find this answer useful please consider clicking on the thumbs-up vote link
thanks in advance for time and attention
John BG