Federer lost to David Nalbandian on Sunday in the Madrid Masters final. The last time the top-ranked Swiss player lost two straight ATP Tour matches was in May 2003, falling to Mark Philippoussis in the third round of the Hamburg Masters and Luis Horna in the first round of the French Open.
"My focus is on Basel, not last week," Federer said. "That said, it's a probably a good thing to get right back into it after a final loss."
Federer led 3-0 in the first set with Berrer scoring only two points. The German finally scored a point on Federer's serve in the seventh game and had only 10 points in the set.
But Federer struggled with his serve in the second set and Berrer took a 4-0 lead. The 12-time Grand Slam champion missed a chance to break back at 2-0, squandering a break point when he returned the ball into the net.
"I'm now having to explain why I lost a set. It's almost laughable," Federer said. "It happens. I wish I could have played better in the second. I was struggling on serve and on the baseline. But I never felt 100 percent comfortable all match."
The pair held serve until 3-2 into the third, when Federer got a break point after the German botched a drop shot and then double-faulted.
Federer wasted his first match point by sending a backhand into the net but hit an ace on the next.
"The conditions are different here, slower," Federer said. "The balls are really heavy here. It's hard to put away a winner. I'm glad I came through in the end."
Ferrer, at a career-high No. 6 in the rankings, was also ousted in the first round of the Madrid Masters.