Octave Band Averages from PSD
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi everyone,
I am using a simple code to extract the PSD from a set of time-based sound data. I am now interested in obtaining the octave band averages of this data and I am completely lost. Can anyone help me out?
The code I ave at the moment is:
*clear all
close all
echo on
Fs= 4000; % Sampling Frequency (Hz)
x = xlsread('No Excitation.csv',1,'J35:J52034');
Hs=spectrum.welch;
psd(Hs,x,'Fs',Fs);
echo off;*
Thanks, John
0 commentaires
Réponses (1)
Wayne King
le 6 Oct 2012
Modifié(e) : Wayne King
le 6 Oct 2012
You want to average the power over octave bands? You can do that with the avgpower() method.
t = 0:0.001:1-0.001
Fs = 1000;
x = cos(2*pi*50*t)+1/2*sin(2*pi*200*t)+randn(size(t));
psdest = psd(spectrum.welch,x,'Fs',Fs);
Now to get the average power from [0,100] Hz
pwr = avgpower(psdest,[0 100]);
It may be more useful to consider the percentage of the total power in that interval
totpower = avgpower(psdest,[0 Fs/2]);
100*(pwr/totpower)
Voir également
Catégories
En savoir plus sur Octave dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!