Spectrum estimation

To estimate the DSP of a signal, first we should define the caracteristics of the spectrum estimator. For that, the command spectrum is used.
PSD_spec = spectrum.xxx(parameters)
xxx can be replaced by diffrent methods like : burg, cov (covariance), periodogram, welch, etc
here we use welch.
PSD_spec = spectrum.welch( windowName [by default 'Hamming'], segment length [by default 64], overlap percent [by default 50=50%] )

Once done, la command "psd" can be used:
PSD =  psd( PSD_spec, x, 'Fs' , Fs, 'CenterDC',true, 'NFFT', NFFT)

The output is an object with two fields: data and frequencies. Below, we will trace the PSD of an FSK signal

M = 2;
sampPerSym = 8;
Fs = sampPerSym ;
Rs = Fs / sampPerSym ;
freqSep = Rs;
data = randi([0 1], 100000 , 1);
x_fsk = fskmod(data, M, freqSep, sampPerSym, Fs, 'cont');

PSD_spec = spectrum.welch('Hamming' , 1024 , 50);
PSD_fsk = psd(PSD_spec , x_fsk , 'Fs' , Fs , 'CenterDC',true, 'NFFT', 1024);
plot(PSD_fsk.frequencies, 10*log10(PSD_fsk.data));
xlabel ( 'f / R_b' );
ylabel ( 'PSD (dB)' );
grid;