0
$\begingroup$

Why these cross-connections in the allpass filter?

enter image description here

and what do negative and positive $k_1$ really refer to?

Is it when the signal is going downwards or is it when the signal is below the zero line?

$\endgroup$
  • $\begingroup$ It's a ladder filter $\endgroup$ – user28715 Jul 15 '17 at 17:11
  • $\begingroup$ @StanleyPawlukiewicz, it's one rung of the ladder. to the OP, your diagram is exactly the same as this diagram but folded around differently. the $k_1,k_2...$ are gains and all of them have magnitude less than one. just analyze the block diagram (either folded over like above or the other one) and obtain the transfer function $H(z)$ and you will see it's an APF. $\endgroup$ – robert bristow-johnson Jul 15 '17 at 21:32
  • $\begingroup$ @robertbristow-johnson So are signals treated as their amplitudes being between [0,1] in this context, rather than [-1, 1]? $\endgroup$ – mavavilj Jul 16 '17 at 9:15
  • 1
    $\begingroup$ the signals $x[n]$ can be anything. but $ -1 \le k_1 \le +1$ and same for $k_2$. this is needed for stability. $\endgroup$ – robert bristow-johnson Jul 16 '17 at 9:17
  • $\begingroup$ @robertbristow-johnson But don't the signals have to have negative and positive parts in order for the gains being in [-1,1] to make any sense? Since I believe that the idea of $-k_1$ here is to "negate" the effect of $k_1$. $\endgroup$ – mavavilj Jul 16 '17 at 9:20
2
$\begingroup$

Let me provide the same answer as provided by @msm,

First of all I would like to replace the lattice with the following block diagram : enter image description here

In which I would like to introduce two new variables $v[n]$ and $w[n]$ to simplify the derivation. Let's use the $\mathcal{Z}$-transform approach which yields the easiest solution:

From the diagram it's obvious that: $$ Y(z) = W(z) + k_1 V(z)$$ $$ W(z) = z^{-1} V(z)$$ $$V(z) = X(z) - k_1 W(z)$$

The last two lines can be combined to produce: $$X(z) = (1 + k_1 z^{-1}) V(z)$$

Then the first line becomes: $$Y(z) = z^{-1} \left( \frac{X(z)}{1 + k_1 z^{-1}} \right) + k_1 \left( \frac{X(z)}{1 + k_1 z^{-1}} \right)$$

After simplifying you get: $$Y(z) = X(z) \left( \frac{k_1 + z^{-1}}{1 + k_1 z^{-1}} \right) $$

and therefore the transfer function of the system is: $$H(z) = \frac{Y(z)}{X(z)} = \frac{k_1 + z^{-1}}{1 + k_1 z^{-1}} $$

as msm stated it's an all-pass filter whose magnitude response is unity and therefore used for its phase response instead...

$\endgroup$
  • 3
    $\begingroup$ both you and msm get a +1 from me. and also for pointing out that this one rung of the ladder is the same signal flow topology as the standard left-to-right block diagram. one thing that i will point out is that the unit delay element $z^{-1}$ need not be just a unit sample delay. it can be a delay of any amount and this is still an APF. in fact, that delay element does nothing other than change the phase of the signal passing through it (delay elements are "linear phase" changers) so that delay element could be replaced with another APF. we might call that "nested APFs". $\endgroup$ – robert bristow-johnson Jul 15 '17 at 21:38
  • $\begingroup$ Thanks for the +1! DSP world is not really paying back well enough, considering the amount of extreme hard work involved :-) Regarding your definition of the nested APFs. The phase response of an APF is not linear, due to its pole, so wouldn't that cause a problem there? (in conjunction with your previous statement of linear phase property of the delay element to be used in replacement) $\endgroup$ – Fat32 Jul 15 '17 at 22:12
  • $\begingroup$ consider what makes this an APF. the internal delay is the only component that discriminates w.r.t. frequency. the reason the APF has it's own phase change (which is non-linear, but can be made to approximate linear phase when the pole is < 0. so the internal nested APF just replaces that role, but at some specific frequency, shifts the phase by a different amount. $\endgroup$ – robert bristow-johnson Jul 16 '17 at 1:37
  • 1
    $\begingroup$ but it's still first-order, so that's just a complicated way to change $k_1$ . you make it a second-order APF if this nested internal APF is also in series with a $z^{-1}$ unit delay. and that is exactly the form of a 2nd-order APF in ladder form. $\endgroup$ – robert bristow-johnson Jul 16 '17 at 1:40
  • $\begingroup$ Yes, but WHY are the gains there? I didn't ask, whether it's an allpass or not, but why does an allpass structure have those cross-connections? $\endgroup$ – mavavilj Jul 16 '17 at 9:13
2
$\begingroup$

This is called a lattice structure implementation of all-pass filters.

$k_1$ and $-k_1$ are scalar gains. The input to the delay element is $$a[n]=x[n]-k_1a[n-1]$$ taking the $z$-transform, the transfer function is $$A(z)(1+k_1z^{-1})=X(z)\Rightarrow A(z)=\frac{X(z)}{1+k_1z^{-1}}$$ and the output is $$\begin{align} y[n]&=k_1a[n]+a[n-1]\\ \end{align}$$ Thus $$\begin{align} Y(z)&=A(z)(k_1+z^{-1})\\ &=X(z)\frac{k_1+z^{-1}}{1+k_1z^{-1}} \end{align}$$ $$H(z)=\frac{Y(z)}{X(z)}=\frac{k_1+z^{-1}}{1+k_1z^{-1}}$$ So it is an all-pass filter ($|H(e^{j\omega})|=1,\ \forall \omega$) with mirrored coefficients in numerator and denomerator.

$\endgroup$
  • 1
    $\begingroup$ to show that $|H(e^{j\omega})|=1$ you should substitute $z \leftarrow e^{j\omega}$ and grind it out. $\endgroup$ – robert bristow-johnson Jul 15 '17 at 21:42
  • $\begingroup$ Yes, but WHY are the gains there? I didn't ask, whether it's an allpass or not, but why does an allpass structure have those cross-connections? $\endgroup$ – mavavilj Jul 16 '17 at 9:13
  • $\begingroup$ You probably know why the delay element is there (since you didn't ask about it). The two gains are also there for the exact same reason :) More seriously: They overall lead to a desired input-output relation. If you know other ways to combine two gains and a delay that achieve an all-pass input-output relationship (and you can prove it as I did), then they are also acceptable structures (maybe with different features and pros and cons), and you can publish it is your paper/book @mavavilj. $\endgroup$ – msm Jul 16 '17 at 12:43
  • $\begingroup$ Good, you can add your new answer as well. $\endgroup$ – msm Jul 16 '17 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.