Filter löschen
Filter löschen

How do I calculate an exponentially weighted moving mean?

10 Ansichten (letzte 30 Tage)
Cai Chin
Cai Chin am 31 Okt. 2020
Bearbeitet: Cai Chin am 2 Nov. 2020
Hi, I am using MATLAB R2020a with MacOS. I am trying to find the exponentially weighted moving mean of the cycle period of an ECG signal, and have used the dsp.MovingAverage function from the DSP signal processing toolbox, and called the commands shown. However, I am not sure how to specify how many of the elements of the vector to include in the weighted mean.
movavgexp = dsp.MovingAverage(10, 'Method', 'Exponential weighting', 'ForgettingFactor', 0.1);
Adding the 'WindowLength' command causes the following warning:
Warning: The WindowLength property is not relevant in this configuration of the System
object.
I would really appreciate any suggestions for this, thanks in advance!

Akzeptierte Antwort

Adam Danz
Adam Danz am 31 Okt. 2020
"At the moment, is it just adding a weight to all of the elements and then finding the moving mean? "
From the documentation,
> As the age of the data increases, the magnitude of the weighting factor decreases exponentially and never reaches zero. In other words, the recent data has more influence on the current average than the older data.
Here's a detailed explanation of each method:
" how to specify how many of the elements of the vector to include in the weighted mean"
That's the first input movAvg = dsp.MovingAverage(Len)
  1 Kommentar
Cai Chin
Cai Chin am 31 Okt. 2020
Hi, thank you for this suggestion. I had tried this before but it gave the following warning:
Warning: The WindowLength property is not relevant in this configuration of the System
object.
Does this mean that I can still use it or will it not only apply the weights to the number of elements that I want it to?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with DSP System Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by