There is no difference with respect to autograd of having the pre-emphasis happening outside vs. inside the network. Autograd records the operations performed to Variable-wrapped tensor data and uses those to compute gradients in a backward pass.
As I understand it, you’re trying to get gradients on Y and not X. To accomplish that, you’d have to wrap Y in a Variable after X (as a tensor, not a Variable) comes out of the pre-emphasis step.