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

45 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?
  2 Comments
Adam Danz
Adam Danz on 20 Jan 2021
Edited: Adam Danz on 21 Jan 2021
> Is it possible to dermine it straightforward with this code: MAV = mean(abs(signal));
Yes. That line describes the mean absolute value.
The code you shared appears to take a subsection of the input and then normalizes it by the maximum absolute value (not the mean). I don't know what the for-loop is doing.

Sign in to comment.

Answers (2)

Star Strider
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.
  2 Comments
Star Strider
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.

Sign in to comment.


Image Analyst
Image Analyst on 20 Jan 2021
Not sure what you mean by "Mean Average Signal" - that's kind of redundant isn't it. Mean and Average mean the same thing. What your code does is compute the "mean of the absolute value of the signal" which will be greater than zero (unless your signal is exactly zero everywhere). Like Star said, the Mean Signal of an acoustic signal will usually be very close to zero because the number of positive values and negative values is about the same. But if you take the absolute value, those negative values flip to the positive side so the mean (or average - same thing) of the absolute value of the signal will be greater than zero. But an ecg is not like an ordinary acoustic signal like an audio waveform of your favorite song, so the mean of an ecg signal will probably be positive even if you don't take the absolute value. Star is a physician so he can correct me if I'm wrong.

Categories

Find more on Audio Processing Algorithm Design in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!