Electromagnetic sensing of materials