Transfer function of a lattice phase equalizer? Consider the lattice phase equalizer circuit below:

It's a two port network with input terminals $A$ and $B$ on the top left and bottom left resp.,and output terminals $C$ and $D$ on the top right and bottom right resp. The labels $Z$ and $Z'$ denote complex impedances. Assume the input voltage $V_{in}=V_{AB}$ is a sinusoidal waveform with angular frequency $\omega$ and assume the circuit is operating in the steady-state. Let $V_{out}=V_{CD}$.
I want to find the transfer function of the network $H(\omega)=V_{out}(\omega)/V_{in}(\omega)$. 
First lets remove the criss-cross by flipping wire $BD$ (the circuit becomes a square). Then rotate the circuit 45 degrees counter-clockwise and we get the equivalent circuit below:

From now on we use phasor representations. We have $V_{out}=V_{CD}=V_{CB}+V_{BD}$. By division of voltage we have $V_{BD}=-V_{in}[Z/(Z+Z')]$ and $V_{CB}=V_{in}[Z'/(Z+Z')]$.
Hence $V_{out}/V_{in}=(Z'-Z)/(Z+Z')$.
However this is not the correct answer, according to Wikipedia: https://en.wikipedia.org/wiki/Lattice_phase_equaliser
I'm not sure what I did wrong, but in any case the correct answer should have the property that the gain $|H(\omega)|$ is independent of $\omega$, as a lattice phase equalizer is an all-pass filter.
 A: You haven't done anything wrong. What that Wikipedia page doesn't explicitly tell you (it's actually implicit in the words "characteristic impedance $Z_0$ given by $Z_0^2 = Z\,Z^\prime$) is that this filter, like all passive filters, is meant to be used with its output terminated by the characteristic impedance. So you need to analyze the circuit with an impedance of $Z_0$ across the terminals CD to get the Wikipedia page article's expression.
When terminated by the characteristic impedance, the filter reflects this impedance to the input too, i.e. the impedance across the terminals AB will also be $Z_0$. This means that any system of filter stages can be chained together and work precisely as given by their transfer functions as long as they are all designed for a characteristic impedance of $Z_0$. You don't need to buffer the stages - the fact that a nonzero current is drawn by each is already precisely accounted for.
The words characteristic impedance come from the usage of these words in electromagnetics (as in the characteristic impedance of freespace is $\sqrt{\mu_0/\epsilon_0}$). This is because the full theory of such filters is actually clearer if one uses a scattering matrix and travelling wave conception of them.
