how to calculate mean of power spectrum

조회 수: 22 (최근 30일)
PRAMOD A
PRAMOD A 2022년 1월 20일
댓글: PRAMOD A 2022년 1월 27일
Hi all,
Please explain me how to calculate the mean of power spectrum for the below dataset.
My dataset is long having more than 50,000 rows and two columns(time domain and Fx values)
The data set is attached with this question.
In the dataset first clumn indicates time in seconds and second column indicates force in newton.
So, basically its a time domain signal and need to convert to frequency domain for the calculation of Mean of Power Spectrum, Frequency centroid and Mean square frequency.
Can anyone explain me how to get the above values from the dataset.

답변 (1개)

Sourav Karmakar
Sourav Karmakar 2022년 1월 27일
Hey Pramod,
As per my understanding, you want to calculate the mean of power spectrum from the attached dataset.
So, for that first import the data in your MATLAB workspace and then use the following code :
% Calculation of Mean of Power Spectrum
t = Data{:,1}';
Fx = Data{:,2}';
nfft = 2^nextpow2(length(Fx));
Pxx = abs(fft(Fx,nfft)).^2/length(Fx);
Hpsd = dspdata.psd(Pxx(1:length(Pxx)/2));
%plot(Hpsd); %Uncomment it to view the plotting of the power spectrum
meanPSD = mean(Hpsd.Data) %stores the mean of power spectrum
You can refer the documentation of Power spectrum - MATLAB to know more about the other details and functionalities.
These are some useful links to solve the other two:
Hope this helps!
  댓글 수: 1
PRAMOD A
PRAMOD A 2022년 1월 27일
Thank you Team,
I could able to understand your codes and run it.
Can you please write the codes from same data set for calculation
i) Spectral centroid
ii) Mean square frequency
You had provided links for the above but i am not able to get it.
My sincere and humbly request to please send the codes as it will be a great knowledge transfer

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by