I'm not sure .... I've spotted that too --- this is what the matlab code does and as it is it produces the expected output. @sebastienmarti any comments / thoughts?