O(N) model for charge density waves