  We analyze the wave equation in mixed form, with periodic and/or Dirichlet
homogeneous boundary conditions, and nonconstant coefficients that depend on
the spatial variable. For the discretization, the weak form of the second
equation is replaced by a strong form, written in terms of a projection
operator. The system of equations is discretized with B-splines forming a De
Rham complex along with suitable commutative projectors for the approximation
of the second equation. The discrete scheme is energy conservative when
discretized in time with a conservative method such as Crank-Nicolson. We
propose a convergence analysis of the method to study the dependence with
respect to the mesh size $h$, with focus on the consistency error. Numerical
results show optimal convergence of the error in energy norm, and a relative
error in energy conservation for long-time simulations of the order of machine
precision.
