Why do you think that?
Opto-coupler isolate electrically but they will transfer fast signals.
As JohnRob said you need to filter the signal. There are online RC filter calculators that you can use. Just use Google "rc filter calculator". Choose a capacitor and the cut off frequency and the calculator will give you the required resistor value.