Heh. The simple ones (Such as the swedish 120mm STRIX mortar shell) do that.
The fancier models use a suite of sensors. Dunno about the SFW, but the Sensor-Fuzed SADARM uses a combination of mm-wavelength radar and acoustics, maybe IR too. BATS use IR and acoustics. They're supposed to be able to distinguish between decoys and the real thing.
These things are way cool, but they aren't cheap.