Effacer les filtres
Effacer les filtres

Perform summation on a cell array according to a equation

2 vues (au cours des 30 derniers jours)
Karthik Brs
Karthik Brs le 30 Oct 2015
Hello, I am required to calculate the overall sound power which is the result of adding the columns(element wise) of a cell array. The addition must be performed according to the equation as can be seen in the attached figure 'Formula.png'. I am also attaching the 'Myvariables.mat' file which contains the cell array.
The 'L1' and 'L2' in the figure in my case represents the elements of cell array(column-wise). Please help!
Thank you in advance!

Réponses (1)

Geoff Hayes
Geoff Hayes le 30 Oct 2015
Karthik - if we assume that all elements in your array are in units of decibels (which you have stated in your previous questions at http://www.mathworks.com/matlabcentral/answers/251779-logarithmic-summation-of-cell-array), then the above equation is telling us that we have to invert those values, sum them, and then apply the 10*log10 to this sum. We can do this as follows with a sample array
b = 122; % random values created in the range of 100 and 122 decibels
a = 100;
dbValues = (b-a).*rand(100,1) + a;
overallSoundDb = 10*log10(sum(10.^(dbValues/10)));
As an aside, if y is in decibels and is calculated as
y = 10*log10(x)
then to get the inverse of y (i.e. x) we do
x = 10^(y/10);

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by