A theory of waves