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: 
> 
> Then I used an optocoupler an the ringing completely disappeared.
> 
> 
> 

You applied a load at the end of the cable and found that it reduced transmission line reflections to a reasonably low level. This shouldn't mean: -

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

That would be an incorrect assumption based on your observation. When sending pulses down a cable, to avoid reflections and ringing you use a cable terminating resistor. The opto removed excess energy from the signal as it came across what would be an open circuit and the load that the opto supplied made things better.

> 
> 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.
> 
> 
> 

That is a pretty good reason for using an opto coupler - it also prevents destructive earth fault currents passing through sensitive measurement apparatus. It is an effective counter-measure to common-mode noise or interference.
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.