# Period, amplitude and phase through FFT in MATLAB

I need to compute period, amplitude and phase of the signal from spectrum analyser. It looks like a sine wave. Since i am new to MATLAB and also have limited idea about Fourier transforms, I am looking for a simplified explanation of how i might use FFT to compute period, phase and amplitude through MATLAB programming. The information i have regarding signal are: sweep time: 0.3183s sweep: 2001 save loop: 100. Thank you so much in anticipation.

Suppose your signal is x.

L = length(x);                   %%% Length of your signal
nfft = L;                        %%% number of points in your fft
res = fft(x,nfft)/nfft;          %%% taking fft of your signal
f = fs/2*linspace(0,1,nfft/2+1); %%% defining correct frequency axis
res = res(1:nfft/2+1);           % half spectrum becos fft result is mirror
figure, plot(f,abs(res));        % here you can amplitude in freq domain
figure, plot(f,angle(res));      % here you can see phase in freq domain.


Hopefully, this will be helpful to you.

• To complete the answer, if your signal is a sine wave, you will see a peak in the frequency of the sine. Therefore, once you know the frequency, you will be able to calculate the period. The amplitude and the phase you can get directly from the graphs that @Urban_Yogi showed how to plot. – JohnMarvin Sep 8 '15 at 16:07