Question: How does an optocoupler filter noise?

As an illustrative example, below three remote sensors are receiving pulses from a single source:

[![enter image description here](https://i.stack.imgur.com/GsCPT.png)](https://i.stack.imgur.com/GsCPT.png)

In the top scheme there is no optocoupler/optoisolator. In the second scheme there is an optocoupler(colored in green) right before each sensor.

And i actually tested this. I first connected the source pulse train to a 100m coaxial cable and at the end of the cable I hooked it up to an oscilloscope. I didn't perform noise analysis but the first thing I noticed was there random was ringing twice the pulse amplitude seen on the scope.

Then I used an optocoupler an the ringing completely disappeared.

This made me believe that the optoisolator really works good for long distances.

One thing I can see that it separates the ground of the source and the receiver. But that would I guess only take care of the 60/50Hz ground loop noise. 

How is an optocoupler/isolator filtering the noise? How can we understand the logic behind?

Answer: 
One thing not mentioned: **isolation** for **ground loop** prevention
In circuits with many loads and components, sometimes the current transfer from the ground and generate an error for analog and digital input/output.

I saw many errors in the circuit without isolation for long cable and high power circuit.

Isolation helps us analyzing each circuit separately. In the complicated circuit, when all parts have one ground many problems such as ground loop, coupling with transformer and etc may arise which analyzing errors are hard.
The analysis is simple.

The isolation in the optocoupler is very high resistance but ~ 25 pF coupling capacitance. The input ESR of the diode is low (Zt or ESR = 10 ) + current limiting R . The Common Mode impedance across the interface is thus very high 100M?//25pF and this reduces output voltage/current by the load impedance.

The stray mutual inductance of a long cable depends on stray wires nearby carrying currents with cable capacitance causing a ripple effect of induced DC noise pulses and/or AC “hum” due this high mutual coupling impedance. When the paired input wires are not balanced or shielded or have low mutual impedance to say earth ground, then they pick up noise voltage. Thus EM shielding and filtering is often used as well as Opto isolation.