Spectral phase correlator for coded waveform recognition using second harmonic generation