wave formation explained