Sound speed of a Bose-Einstein condensate in an optical lattice