Ratio detector