Spectral approach to homogenization of an elliptic operator periodic in some directions