Qusay - let us assume the following concerning your signal, sampling rate (Fs), and FFT block size (N)
Fs = 4096;
t = linspace(0,1-1/Fs,Fs);
N = 4096;
signal = 2.3*sin(2*pi*t*227);
Now for your code
Y = fft(signal);
Y = fftshift(Y);
Y = abs(Y);
The following lines of code just sets the frequencies for each bin and can be reduced to
f = [0:N-1] * Fs/N;
f = f - ceil(N/2);
plot(f,Y);
The result of the plot is
Note the frequency at 227 Hz, as expected. The symmetry is due to the input signal being real.
Best Answer