I think it is an easy question but I am stuck.
I want to derive that α=−e−Tτ.
Can someone provide me with an answer?
[EDIT] Sorry guys, this was really a senseless question. Here are some more informations. The differential equation of the EWMA: y(n)=α⋅x(n)+(1−α)y(n−1)
Hence HE(ω3dB)=α√1−2(1−α)cos(ω3dB)+(1−α)2!=1√2.
I'm looking for α, given an ω3dB.
Answer
If I understood you correctly, you want to compute the value of α that results in a specified 3dB cut-off frequency for an exponentially weighted moving average filter. If you square your last equation, you get
α21−2(1−α)cos(ωc)+(1−α)2=12
which can be rearranged into the following quadratic equation:
α2+2α(1−cos(ωc))−2(1−cos(ωc))=0
with the positive solution
α=cos(ωc)−1+√cos2(ωc)−4cos(ωc)+3
So, e.g., for a desired cut-off frequency ωc=0.2π, you obtain from (3) a value of α=0.455886780102867. The figure below shows the magnitude of the frequency response of the resulting exponentially weighted moving average filter, from which you can see that the desired cut-off frequency is achieved.
EDIT: The formula for α in your question should actually be
α=1−e−T/τ,τ=1/Ωc
Note that unlike ωc in Eq. (3), Ωc in Eq. (4) is not normalized by the sampling frequency. So we have −T/τ=−ΩcT=−ωc.
Eq. (4) is an approximation, and it comes from applying the impulse invariant transformation to the continuous-time transfer function
H(s)=11+sτ
which has a 3dB cut-off frequency ωc=1/τ. Applying the impulse invariant transformation to (5) gives
H(z)=Tτ11−e−T/τz−1
Comparing the denominator of (6) with the denominator of the discrete-time transfer function of an EWMA filter
H(z)=α1−(1−α)z−1
results in the given formula. Note, however, that this is only an approximation. Especially for cut-off frequencies close to Nyquist, the error of formula (4) becomes relatively large.
No comments:
Post a Comment