Two of the most counterproductive effects that must be dealt with in communication systems in realistic environments are carrier frequency offset (CFO) and time-varying channels. These problems are usually addressed by using independent approaches for each one. This paper introduces an algorithm that attacks both of these effects in a joint fashion. It is based on a rough compensation of CFO, and after considering that the remaining CFO uncertainty can be seen as part of the time-varying channel a channel estimation that includes that composite channel is performed. Particularly, the channel estimation based on projection onto a bidimensional basis is shown to be adequate to perform this process. The approach suggested in this paper is illustrated for a superimposed training-based communication system. Simulation results corroborate the validity of the proposed algorithm, where the performance obtained is similar to that achieved for the time-varying channel estimators based on bidimensional basis projection when no CFO is present.