Phase shifter tuned by varying the spring constant of a nanomechanical cantilever