A spectroscopic analysis device for analysis of a sample of a substance, the device comprising: a photonic integrated circuit comprising: an input for receiving light from the sample; a demultiplexer (DEMUX); at least a first optical chain and a second optical chain; wherein the demultiplexer (DEMUX) is arranged to distribute the received light into the first optical chain and the second optical chain; wherein each optical chain (C1, C2) of the photonic integrated circuit further comprises a tunable bandpass filter (TBF1, TBF2) and a variable attenuator (ATT1, ATT2) and a photodetector (PD1, PD2) arranged respectively to filter and to attenuate and to detect the light distributed into its corresponding optical chain (C1, C2); wherein the spectroscopic analysis device further comprises: a controller arranged: to control the two or more tunable bandpass filters (TBF1, TBF2), to control the two or more variable attenuators (ATT1, ATT2), to receive photodetector results obtained from the two or more photodetectors (PD1, PD2), and to provide spectroscopic analysis results based on the received photodetector results; wherein the controller further comprises a memory (MWCWT) storing a plurality of wavelengths to which the tunable bandpass filters (TBF1, TBF2) should be tuned by the controller and a plurality of coefficients corresponding to the substance; and wherein the controller is further configured to control the two or more variable attenuators (ATT1, ATT2) by applying the spectral coefficients to the variable attenuator (ATT1, ATT2) in each optical chain (C1, C2) such that a power of the light detected by the photodetector (PD1, PD2) in each optical chain (C1, C2) is attenuated based on the applied spectral coefficient. an input for receiving light from the sample; a demultiplexer (DEMUX); at least a first optical chain and a second optical chain; wherein the demultiplexer (DEMUX) is arranged to distribute the received light into the first optical chain and the second optical chain; wherein each optical chain (C1, C2) of the photonic integrated circuit further comprises a tunable bandpass filter (TBF1, TBF2) and a variable attenuator (ATT1, ATT2) and a photodetector (PD1, PD2) arranged respectively to filter and to attenuate and to detect the light distributed into its corresponding optical chain (C1, C2); wherein the spectroscopic analysis device further comprises: a controller arranged: to control the two or more tunable bandpass filters (TBF1, TBF2), to control the two or more variable attenuators (ATT1, ATT2), to receive photodetector results obtained from the two or more photodetectors (PD1, PD2), and to provide spectroscopic analysis results based on the received photodetector results; wherein the controller further comprises a memory (MWCWT) storing a plurality of wavelengths to which the tunable bandpass filters (TBF1, TBF2) should be tuned by the controller and a plurality of coefficients corresponding to the substance; and wherein the controller is further configured to control the two or more variable attenuators (ATT1, ATT2) by applying the spectral coefficients to the variable attenuator (ATT1, ATT2) in each optical chain (C1, C2) such that a power of the light detected by the photodetector (PD1, PD2) in each optical chain (C1, C2) is attenuated based on the applied spectral coefficient. a controller arranged: to control the two or more tunable bandpass filters (TBF1, TBF2), to control the two or more variable attenuators (ATT1, ATT2), to receive photodetector results obtained from the two or more photodetectors (PD1, PD2), and to provide spectroscopic analysis results based on the received photodetector results; to control the two or more tunable bandpass filters (TBF1, TBF2), to control the two or more variable attenuators (ATT1, ATT2), to receive photodetector results obtained from the two or more photodetectors (PD1, PD2), and to provide spectroscopic analysis results based on the received photodetector results; wherein the controller further comprises a memory (MWCWT) storing a plurality of wavelengths to which the tunable bandpass filters (TBF1, TBF2) should be tuned by the controller and a plurality of coefficients corresponding to the substance; and wherein the controller is further configured to control the two or more variable attenuators (ATT1, ATT2) by applying the spectral coefficients to the variable attenuator (ATT1, ATT2) in each optical chain (C1, C2) such that a power of the light detected by the photodetector (PD1, PD2) in each optical chain (C1, C2) is attenuated based on the applied spectral coefficient.