O ile dobrze pamiętam jeżeli używasz funkcji fft lub fftshift zwracane widmo aplitudowe jest dwustronne. Jednakże możliwym jest wyświetlenie widma jednostronnego poprzez odpowiednie rysowanie wykresu - skali x czyli naszej skali częstotliwości. Tu masz cytat, który Ci pomoże.
That code uses the fft so yes, it is the same thing.
The fft is a transform which gives you a complex result spanning negative and positive frequencies ( -nyquist to +nyquist ). The single-side spectrum throws away the negative frequencies which are often not required for things like plotting spectrum to obtain a single-side spectrum.
So the fft is the method used to transform from the time domain to the frequency domain, but its result requires some manipulation afterwards to obtain what is often the desired result, a single-sided power spectrum.
The code:
ff = Fs/2*linspace(0,1,NFFT/2+1);
is taking the positive half of the spectrum (NFFT/2 +1 gives this, including 0 and nyquist, hence the +1) and mapping it onto your real frequencies from 'normalised frequency'.