Patent attributes
An echo cancellation system that detects and compensates for differences in sample rates between the echo cancellation system and a set of wireless speakers based on a frequency-domain analysis. The system generates Fourier transforms for a microphone signal and a reference signal and determines a series of angles for individual frames. For each tone in the Fourier transforms, the system determines the angles and uses linear regression to determine an individual frequency offset associated with the tone. Using the individual frequency offsets associated with the tones, the system uses linear regression to determine an overall frequency offset between the audio sent to the speakers and the audio received from a microphone. Based on the overall frequency offset, samples of the audio are added or dropped when echo cancellation is performed, compensating for the frequency offset.