Median Frequency(Fmed)

1 view (last 30 days)
shez96
shez96 on 9 Apr 2012
Commented: krn99 on 5 Apr 2017
I need help finding the Median frequency of a power spectram. (Fmed), I am new to matlab so any helo will be really appreciated.

Accepted Answer

Wayne King
Wayne King on 9 Apr 2012
Hi Shenal, you can do the following:
t = 0:0.001:1-0.001;
x = cos(2*pi*50*t-pi/4)+0.5*sin(2*pi*100*t)+randn(size(t));
psdest = psd(spectrum.periodogram,x,'Fs',1000,'NFFT',length(x));
normcumsumpsd = cumsum(psdest.Data)./sum(psdest.Data);
Ind = find(normcumsumpsd <=0.5,1,'last');
fprintf('Median frequency is %2.3f Hz\n',psdest.Frequencies(Ind));
  2 Comments
shez96
shez96 on 10 Apr 2012
THanks for that
krn99
krn99 on 5 Apr 2017
is that above code is applicable for 200000 sample emg signal

Sign in to comment.

More Answers (1)

Greg Dionne
Greg Dionne on 28 Oct 2016
Try: medfreq
Introduced in R2015a.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!