@Olin's answer is a good one if you can live within the limitations which are:
- High voltage supply for the comparator (or special comparator)
- Duty cycle of input close to 50%
- Some pulses will be missed when the signal is first applied.
It has the great advantage of being non-critical as to component values (it automagically adjusts to the average input voltage) and has a good noise immunity once it adjusts.
There are a couple other simple options. First, you could simply use a 2.5V reference and divide down the input with a voltage divider such that 13V gives you 2.5V out. Since you would have only +/-7% (minus whatever noise immunity you require) to play with, this makes for a relatively critical circuit.
simulate this circuit – Schematic created using CircuitLab
It will also stop working if the input voltages change by a small percentage.
A third option is a DC restoration type of circuit that AC couples the input. Again, a comparator is used.
simulate this circuit
In the case of my first circuit the signal level is faithfully preserved if the input stops switching. In the case of Olin's circuit, the input noise immunity drops to close to zero if the signal disappears so you could see random noise at the output. In the case of my 2nd circuit, the output will eventually drift to one state or the other (the state can be enforced by a resistor from the + input of the comparator to +2.5 or ground).
In all 3 cases you could add some hysteresis by feeding back a bit of the output voltage to the + input.