필터 지우기
필터 지우기

Perform summation on a cell array according to a equation

조회 수: 2 (최근 30일)
Karthik Brs
Karthik Brs 2015년 10월 30일
답변: Geoff Hayes 2015년 10월 30일
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!

답변 (1개)

Geoff Hayes
Geoff Hayes 2015년 10월 30일
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);

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by