Spectrum demodulating polarimeter based on weak measurement with a phase modulation