A system for tracking a femoral frame of reference in computer-assisted surgery comprises a sensor unit. The sensor unit is adapted to be secured to the femur. The sensor unit comprises accelerometer and gyroscope sensors that produce orientation data. A processing unit receives gyroscope and accelerometer data. The processing unit comprises a gyroscope-data calculator to provide calculated acceleration data resulting from movements of the femur, an accelerometer-data calculator to calculate measured acceleration data resulting from movements of the femur, and an acceleration comparator to relate an orientation of the sensor unit to the femur to define a femoral frame of reference. The femoral frame of reference is defined from the comparison between the calculated and the measured acceleration data. A sensor orientation interface provides orientation data for the femur from a tracking of the femoral frame of reference. A method for tracking a femoral frame of reference is also provided.