Skip to main content
added 468 characters in body
Source Link
Hilmar
  • 48.2k
  • 1
  • 32
  • 66

Of course.

The difference is linear operation so you simply get $$H(z) = H_1(z)-H_2(z)$$

The Z transform of a moving average filter of length N is simply $H_N(z) = \frac{1-z^{-N}}{1-z^{-1}}$ so in your case you get

$H(z) = \frac{1-z^{-10}}{1-z^{-1}}-\frac{1-z^{-21}}{1-z^{-1}}$

Pop in $z = e^{-j\omega}$ for your frequency of interest and solve for amplitude and phase shift.

Please note that this is dependent in how you time align the two moving average windows. The formula above assumes the both are aligned at the beginning. If you want to align them at the center you need apply a delay term to the shorter one as well. In your case you can't really do this since one window size is even and the other is odd.

Update based on Dan's comment

We can easily continue $H(z) = \frac{1-z^{-10}}{1-z^{-1}}-\frac{1-z^{-21}}{1-z^{-1}} = \frac{-z^{-10}+z^{-21}}{1-z^{-1}} = -z^{-10} \cdot \frac{1-z^{-11}}{1-z^{-1}}$

This is a moving average filter of length 11 cascaded with a 10 tap sample delay and multiplied with -1. That's also obvious if you subtract the impulse responses in the time domain: the first 10 samples cancel and you are left with the last 11 samples of the 21 tap filter.

Of course.

The difference is linear operation so you simply get $$H(z) = H_1(z)-H_2(z)$$

The Z transform of a moving average filter of length N is simply $H_N(z) = \frac{1-z^{-N}}{1-z^{-1}}$ so in your case you get

$H(z) = \frac{1-z^{-10}}{1-z^{-1}}-\frac{1-z^{-21}}{1-z^{-1}}$

Pop in $z = e^{-j\omega}$ for your frequency of interest and solve for amplitude and phase shift.

Please note that this is dependent in how you time align the two moving average windows. The formula above assumes the both are aligned at the beginning. If you want to align them at the center you need apply a delay term to the shorter one as well. In your case you can't really do this since one window size is even and the other is odd.

Of course.

The difference is linear operation so you simply get $$H(z) = H_1(z)-H_2(z)$$

The Z transform of a moving average filter of length N is simply $H_N(z) = \frac{1-z^{-N}}{1-z^{-1}}$ so in your case you get

$H(z) = \frac{1-z^{-10}}{1-z^{-1}}-\frac{1-z^{-21}}{1-z^{-1}}$

Pop in $z = e^{-j\omega}$ for your frequency of interest and solve for amplitude and phase shift.

Please note that this is dependent in how you time align the two moving average windows. The formula above assumes the both are aligned at the beginning. If you want to align them at the center you need apply a delay term to the shorter one as well. In your case you can't really do this since one window size is even and the other is odd.

Update based on Dan's comment

We can easily continue $H(z) = \frac{1-z^{-10}}{1-z^{-1}}-\frac{1-z^{-21}}{1-z^{-1}} = \frac{-z^{-10}+z^{-21}}{1-z^{-1}} = -z^{-10} \cdot \frac{1-z^{-11}}{1-z^{-1}}$

This is a moving average filter of length 11 cascaded with a 10 tap sample delay and multiplied with -1. That's also obvious if you subtract the impulse responses in the time domain: the first 10 samples cancel and you are left with the last 11 samples of the 21 tap filter.

Source Link
Hilmar
  • 48.2k
  • 1
  • 32
  • 66

Of course.

The difference is linear operation so you simply get $$H(z) = H_1(z)-H_2(z)$$

The Z transform of a moving average filter of length N is simply $H_N(z) = \frac{1-z^{-N}}{1-z^{-1}}$ so in your case you get

$H(z) = \frac{1-z^{-10}}{1-z^{-1}}-\frac{1-z^{-21}}{1-z^{-1}}$

Pop in $z = e^{-j\omega}$ for your frequency of interest and solve for amplitude and phase shift.

Please note that this is dependent in how you time align the two moving average windows. The formula above assumes the both are aligned at the beginning. If you want to align them at the center you need apply a delay term to the shorter one as well. In your case you can't really do this since one window size is even and the other is odd.