The ECM detects misfires by monitoring crankshaft speed fluctuations through the crankshaft position sensor.