Perform summation on a cell array according to a equation
1 view (last 30 days)
Show older comments
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/151229/image.png)
The 'L1' and 'L2' in the figure in my case represents the elements of cell array(column-wise). Please help!
Thank you in advance!
Answers (1)
Geoff Hayes
on 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);
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!