how to calculate mean of power spectrum
조회 수: 21 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
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!
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!