Rafael Nadal is through to the semi-finals of the BNP Paribas Open after a straight sets win over Roger Federer.