If I understand correctly, you want to find the frequency below which you have 50 percent of the signal power. If that's the case, you can use spectrum object to calculate the periodogram and then use cumsum to get the cumulative power distribution. You then just need to find the frequency corresponding to the 50th percetile of the power distribution, using your parameters as an example,
h = spectrum.periodogram;
Hpsd = psd(h,s,'Fs',1000,'NFFT',2*nextpow2(length(s)));
Pdist = cumsum(Hpsd.Data);
Freq = Hpsd.Frequencies;
OverHalfIdx = find(Pdist>=Pdist(end)/2,1,'first');
UnderHalfIdx = find(Pdist<=Pdist(end)/2,1,'last');
MidFreq = (Freq(OverHalfIdx)+Freq(UnderHalfIdx))/2
HTH
Best Answer