On-chip area-efficient spectrum analyzer for testing analog IC