How are waves, energy and matter related?