A capnometer for analysing respiratory system function of a patient, the capnometer comprising: an air flow region through which air from said patient's respiratory system passes; an emitter configured to emit light, said emitter comprising a mid-IR semiconductor emitter configured to provide said emitted light at a wavelength in the range 3-5 μm; a detector to detect said emitted light, said detector comprising a mid-IR semiconductor detector; wherein said emitter and said detector are arranged such that light from said emitter passes through said air flow region to said detector; a memory to store patient data which is specific to said patient; and a signal processor coupled to said detector to analyse a CO 2 waveform representing a variation over time in a CO 2 level of air inhaled and/or exhaled by said patient, wherein said patient data comprises an analysis algorithm and wherein said analysing comprises using said analysis algorithm to analyse respiratory system function; wherein said analysis of said respiratory system function is based on a comparison between said waveform and one or more of said waveforms which were obtained previously for said patient that define a metric with a baseline, wherein said comparing comprises monitoring a deviation of said waveform from said baseline, and wherein said signal processor is further configured to develop said metric with regard to a disease or type of disease of said patient for analysing said respiratory system function with regard to said disease or type of disease; wherein the analysis algorithm is modified based on said analysis of said CO 2 waveform by said signal processor and wherein said signal processor is further configured to alter said metric over time based on said waveforms. an air flow region through which air from said patient's respiratory system passes; an emitter configured to emit light, said emitter comprising a mid-IR semiconductor emitter configured to provide said emitted light at a wavelength in the range 3-5 μm; a detector to detect said emitted light, said detector comprising a mid-IR semiconductor detector; wherein said emitter and said detector are arranged such that light from said emitter passes through said air flow region to said detector; a memory to store patient data which is specific to said patient; and a signal processor coupled to said detector to analyse a CO 2 waveform representing a variation over time in a CO 2 level of air inhaled and/or exhaled by said patient, wherein said patient data comprises an analysis algorithm and wherein said analysing comprises using said analysis algorithm to analyse respiratory system function; wherein said analysis of said respiratory system function is based on a comparison between said waveform and one or more of said waveforms which were obtained previously for said patient that define a metric with a baseline, wherein said comparing comprises monitoring a deviation of said waveform from said baseline, and wherein said signal processor is further configured to develop said metric with regard to a disease or type of disease of said patient for analysing said respiratory system function with regard to said disease or type of disease; wherein the analysis algorithm is modified based on said analysis of said CO 2 waveform by said signal processor and wherein said signal processor is further configured to alter said metric over time based on said waveforms.