Implementations of Low-Pass Filter I should say which of the filters from the following image implements an ideal low-pass filter with cutoff frequency $\frac{\pi}{4}$. In the picture, Sa is a zero insertion filter, which inserts a zero sample after each input sample and Sb is a decimator, which extracts every second sample of its input. The first filter is fine and the second one does not represent the desired low-pass (that's the answer on my book).



However, I've not been able to explain why is the second filter wrong.
I know that up-sampling compresses the frequency content of a signal and that down-sampling expands it. So for the first filter, we first compress the input band by 2 and conclude that if the original limits were less than or equal to $\frac{\pi}{4}$, nothing gets filtered out (because $\frac{\pi}{4}$ becomes $\frac{\pi}{8}$ after Sa). And then, Sb recovers the original spectrum by multiplying by 2.

I analysed the second filter in a similar way, just noticing that Sb was switched with Sa thus making a multiplication by 2 first. The first Frequency Response would not filter anything from inputs with frequency lower than $\frac{\pi}{4}$ (which becomes $\frac{\pi}{2}$ after Sb). Then, after Sa, we have a division by 2 which restores the original spectrum and anything less than $\frac{\pi}{4}$ can proceed to the output.

What am I doing wrong?
If the input sequence is band limited to $\pi/2$, the second alternative is also OK (as you realized with your argument). However, if it not band limited you will get aliasing, so it is not a feasible solution in the general case.