Phase space reduction of non linear dynamical systems by Karhunen-Loève expansion