A 1-MHz area-efficient on-chip spectrum analyzer for analog testing