50 views (last 30 days)

Please, How do I determine the Mean Absolute Value (MAD) of an acoustic signal, which has positive and negative data points?

Is it possible to dermine it straightforward with this code:

MAV = mean(abs(signal));

However,

I came across, this code which I modified with my signal. My signal length is 13,230,000 data point, fs = 44100, time 300 sec.

xrec = S_ff_1500W_data3_50; % replace for your signal and Fs

N=length(xrec); %xrec is my ecg signal

A= 300*fs; % step 1

seg = xrec(1:A);

seg = seg/max(abs(seg)); % step 2

% Step 3

Y=0;

for i=1:A

Y=Y+max(abs(seg(i)));

end

MAV=(1/A)*Y

% more efficient Step 3

MAV = mean(abs(seg(1:A)))

Please, any explanation?

Star Strider
on 20 Jan 2021

The mean value is the ‘average’ value. In almost all audio signals, the mean value is either 0 or close to 0.

An electrocardiogram signal will have a mean value different than 0 (depending on the lead), since (in most leads) there is generally postive (or negative) deflection that creates a non-zero mean value. See Braunwald’s Heart Disease for an extensive explanation.

Star Strider
on 20 Jan 2021

My pleasure!

The mean absolute value of a EKG should not be much different than the mean of the original EKG in leads and . It will be the opposite sign (positive) in lead and and the right precordial leads , and in all leads wher it has a normally near-isoelectric mean. These will obviously not hold in the presence of cardiac disease. There is absolutely no reason to calculate the mean absolute value of an EKG, since that obscures necessary information. If you want to get an estimate of the power (although the reason to do that escapes me), either square it, or more reliably, take the RMS (root-mean-square) value of the vector. Again, see Braunwald for an extensive discussion.

Image Analyst
on 20 Jan 2021

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

Start Hunting!
## 2 Comments

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/721699-please-how-do-i-determine-the-mean-absolute-value-mav-of-an-acoustic-signal-which-has-positive-a#comment_1274899

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/721699-please-how-do-i-determine-the-mean-absolute-value-mav-of-an-acoustic-signal-which-has-positive-a#comment_1274899

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/721699-please-how-do-i-determine-the-mean-absolute-value-mav-of-an-acoustic-signal-which-has-positive-a#comment_1275593

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/721699-please-how-do-i-determine-the-mean-absolute-value-mav-of-an-acoustic-signal-which-has-positive-a#comment_1275593

Sign in to comment.