Photonics-Based Real-Time Spectral Analysis Over 40-GHz Bandwidth with Fine Frequency Resolution