“It’s just not the way to go forward so unfortunately for the medium-to-long term to feel better I will need surgery.
“I decided to do it. I will be on crutches for many weeks and then out of the game for many months.”
Despite admitting last week that his retirement is “getting closer now”, Federer remains optimistic he may be able to recover enough to return to competitive action.
He continued: “It’s going to be difficult of course but at the same time, it’s the right thing to do because I want to be healthy.
“I want to be running around later and I want to give myself a glimmer of hope to return to the tour in some shape or form.
“I am realistic don’t get me wrong, I know how difficult it is at this age right now to do another surgery and try it.
“But I want to be healthy and I’ll go through the rehab process with the goal, while I’m still active, which I think is going to help me during this long period of time.”