A device for measuring OSNR of a WDM optical signal including a plurality of wavelength channels, the device comprising: an input port; an optical train coupled to the input port and including serially connected a tunable optical filter for selecting a wavelength channel of the plurality of wavelength channels, a polarization controller for adjusting a polarization state of the selected wavelength channel, a polarization selector disposed in the optical train downstream of the polarization controller, for selecting a polarization state of the selected wavelength channel,and a photodetector disposed in the optical train downstream of the tunable optical filter, the polarization controller, and the polarization selector, for detecting a first optical power level of the selected wavelength channel and in the selected polarization state; and a control unit coupled to the tunable optical filter, the polarization controller, and the photodetector, and configured to tune the optical filter to the selected wavelength channel; adjust the polarization controller to reach a target control point, at which the first optical power level is minimized or reduced; and compute the OSNR of the selected wavelength channel from a polarization extinction defined as a ratio of a second optical power level upstream the polarization selector to the first optical power level; wherein the control unit includes a computer processor and a non-transitory memory configured for causing the computer processor to perform a Nelder-Mead heuristic iterative search (200, 400) of the target control point by performing a plurality of iterations including a first iteration and a second iteration after the first, wherein a plurality of control points of the second iteration are selected based on optical power levels detected by the photodetector at a plurality of control points of the first iteration, wherein the plurality of control points of the first and second iterations form first and second Nelder-Mead simplexes, respectively, in a parameter space of the polarization controller; characterized in that the control unit is configured to compute, after a pre-defined number of iterations of the Nelder-Mead search, a difference between polarization extinction values at a current best point and at a reflection point of the current best point; wherein, when the difference is less than the pre-defined amount, the control unit is configured to restart the Nelder-Mead search. an input port; an optical train coupled to the input port and including serially connected a tunable optical filter for selecting a wavelength channel of the plurality of wavelength channels, a polarization controller for adjusting a polarization state of the selected wavelength channel, a polarization selector disposed in the optical train downstream of the polarization controller, for selecting a polarization state of the selected wavelength channel,and a photodetector disposed in the optical train downstream of the tunable optical filter, the polarization controller, and the polarization selector, for detecting a first optical power level of the selected wavelength channel and in the selected polarization state; and a tunable optical filter for selecting a wavelength channel of the plurality of wavelength channels, a polarization controller for adjusting a polarization state of the selected wavelength channel, a polarization selector disposed in the optical train downstream of the polarization controller, for selecting a polarization state of the selected wavelength channel,and a photodetector disposed in the optical train downstream of the tunable optical filter, the polarization controller, and the polarization selector, for detecting a first optical power level of the selected wavelength channel and in the selected polarization state; and a control unit coupled to the tunable optical filter, the polarization controller, and the photodetector, and configured to tune the optical filter to the selected wavelength channel; adjust the polarization controller to reach a target control point, at which the first optical power level is minimized or reduced; and compute the OSNR of the selected wavelength channel from a polarization extinction defined as a ratio of a second optical power level upstream the polarization selector to the first optical power level; wherein the control unit includes a computer processor and a non-transitory memory configured for causing the computer processor to perform a Nelder-Mead heuristic iterative search (200, 400) of the target control point by performing a plurality of iterations including a first iteration and a second iteration after the first, wherein a plurality of control points of the second iteration are selected based on optical power levels detected by the photodetector at a plurality of control points of the first iteration, wherein the plurality of control points of the first and second iterations form first and second Nelder-Mead simplexes, respectively, in a parameter space of the polarization controller; characterized in that the control unit is configured to compute, after a pre-defined number of iterations of the Nelder-Mead search, a difference between polarization extinction values at a current best point and at a reflection point of the current best point; wherein, when the difference is less than the pre-defined amount, the control unit is configured to restart the Nelder-Mead search.