Moving Average Filter

提供: A-VEKT Wiki
ナビゲーションに移動 検索に移動

Ideal Model (理想モデル)

Representation in frequency domain (周波数軸での表記)

Moving Average Filter performs convolution of input signal and rectangular pulse in time domain.

The convolution in time domain equals point-wise multiplication in frequency domain. (https://en.wikipedia.org/wiki/Convolution_theorem)

Thus the frequency response of Moving Average Filter is the same as a representation of rectangular pulse in frequency domain, and it is obtained by performing Fourier Transform of the rectangular pulse. (https://en.wikipedia.org/wiki/Rectangular_function)

移動平均フィルタでは、時間軸において、入力信号と矩形パルスの畳み込み積分が行われます。

畳み込み積分は周波数軸において、周波数成分ごとの乗算と等価となります。

従って、移動平均フィルターの周波数特性は、矩形パルスの周波数軸での表記と同じになり、矩形パルスをフーリエ変換することで求めることができます。

TimeAndFrequencyDomains-MovingAverageFilter.png

Frequency response in dB (周波数特性のdB換算)

The frequency response of Moving Average Filter in dB is shown as the following.

移動平均フィルターの周波数特性をdB表記すると、以下のようになります。

FrequencyResponse-MovingAverageFilter.png

Equivalent Noise Bandwidth(雑音等価帯域幅)

The frequency response of Moving Average Filter in terms of power in antilogarithm is shown as the following.

Here we can observe red and blue shaded areas are equivalent, and Equivalent Noise Bandwidth equals 1/(2a).

移動平均フィルターの周波数特性を電力換算で真数軸で表すと、以下のようになり、赤色の斜線部と青色の斜線部の面積は等しくなります。

このことから、雑音等価帯域幅は1/(2a)であることが分かります。

EquivalentNoiseBandwidth-MovingAverageFilter.png

Example (例)

Let us assume the sampling frequency is 1[kHz] and averaging is performed over 10 samples, we can use a=10[ms] (the period for 10 samples) in above graph.

We observe that 92.8% of the power spectrum from this filter is below 100 [Hz], if the input is an impulse.

If we resample this filter output at 200[Hz], a distortion of 7.2% is expected due to aliasing error happens over 100[Hz] components.

1[kHz]でサンプリングを行い、10個のサンプルを平均化する場合、上の図でa=10[ms](10サンプル分の期間)となります。

インパルス入力の場合、フィルタの出力の92.8%の電力スペクトラムは100[Hz]以内に入ることが分かります。

このフィルタの出力を200[Hz]で再サンプリングを行った場合、100[Hz]以上の成分でエリアジングが発生するため、信号が7.2%歪むことが予想されます。

Z-Transform Model (Z変換モデル)

Suppose averaging is performed over N samples, the model can be illustrated as the following using N-1 delay elements, where z-1 represent an element of delay.

N個のサンプルを平均化する場合、z-1を1個の遅延素子として、N-1個の遅延素子を用いて、以下の図のようにモデルを表すことができます。

Z-TransformModel-MovingAverageFilter.png

The transfer function is represented as:

この伝達関数は以下のように表されます。

Z-TransformTransferFunction-MovingAverageFilter.png

Simply the frequency response is obtained by substitution of the following equation.

単純には、これに以下の式を代入することで、周波数特性を求めることができます。

z=ej 2 π f T

However imaginary part will appear by this formula, which means rotation of the phase. This formula can be modified as follows in order not to include the delay and the frequency response is represented by real number.

しかしながら、この式では、位相の回転を表す虚数成分が出てきます。 そこで、以下のように式を変形することで、遅延を含まない、実数のみで表される周波数特性が得られます。

Z-TransformSplitDelay-MovingAverageFilter.png

Calculation tool for frequency response (周波数特性の計算ツール)

The frequency response in Z-Transform Model can be computed by the following Web App.

Z変換モデルでの周波数特性は以下のウェブアプリで計算することができます。

https://www.avekt.com/WebApps/MovingAverageFilter

Equivalent Noise Bandwidth(雑音等価帯域幅)

Equivalent Noise Bandwidth in Z-Transform Model is equivalent to Ideal Model, that is 1/(2a)=1/(2NT),

where we have a=NT by assuming the sampling frequency of 1/T and the number of samples to average is N.

We observe that the original bandwidth after sampling is 1/(2T) and the noise bandwidth is reduced by a factor of 1/N by averaging over N samples.

Z変換モデルでの雑音等価帯域幅は理想モデルと同じで、1/(2a)=1/(2NT)となります。

ここで、サンプリング周波数を1/T、平均化するサンプル数をN個として、a=NTとなります。

サンプリング後の元の帯域幅は1/(2T)であることから、N個のサンプルの平均化で、雑音の帯域幅が1/Nに減少すると言えます。

Relationship with Central Limit Theorem (中心極限定理との関連)

Suppose we have White Gaussian Noise and the standard deviation is σ, the noise power is expressed as σ2.

If we make averaging over N samples, the standard deviation is reduced to σ/N, and we have noise power of σ2/N due to Central Limit Theorem.

We can also explain that the noise power is reduced by the factor of 1/N by averaging over N samples using Central Limit Theorem.

熱雑音を代表とする白色正規雑音の場合、雑音の振幅の標準偏差をσとするとき、雑音電力はσ2と表されます。

N個のサンプルを平均化した場合、中心極限定理より、標準偏差はσ/√Nとなり、雑音電力はσ2/Nとなります。

このように、N個のサンプルの平均化で雑音電力が1/Nになることは、中心極限定理からも説明することができます。