A playback device comprising:
- an audio input interface;
- an audio stage comprising an audio processor and an audio amplifier;
- one or more speakers;
- one or more microphones;
- at least one processor;
- and
- at least one non-transitory computer-readable medium comprising program instructions that are executable by the at least one processor such that the playback device is configured to:
- receive, via the audio input interface, one or more audio signals;
- play back at least one audio signal of the one or more audio signals via the one or more speakers and the audio stage;
- while playing back the at least one audio signal, capture, via the one or more microphones, audio within an acoustic environment, wherein at least a portion of the captured audio represents sound produced by the one or more speakers in playing back the at least one audio signal via the one or more speakers;
- receive at least one playback signal from the audio stage representing the at least one audio signal being played back by the one or more speakers and the audio stage;
- transform into a short time Fourier transform (STFT) domain the captured audio within the acoustic environment to generate a measured signal representing actual acoustic echo;
- transform into the STFT domain the received playback signal from the audio stage to generate a reference signal;
- during each nth iteration of an acoustic echo canceller (AEC):
- determine an nth frame of an output signal, wherein the program instructions that are executable by the at least one processor such that the playback device is configured to determine the nth frame of the output signal comprises program instructions that are executable by the at least one processor such that the playback device is configured to:
- (i) generate an nth frame of a model signal representing estimated acoustic echo by passing an nth frame of the reference signal through an nth instance of an adaptive filter;
- and
- (ii) generate the nth frame of the output signal by differencing the nth frame of the model signal and an nth frame of the measured signal;
- determine a n+1th instance of the adaptive filter for a next iteration of the AEC, wherein the program instructions that are executable by the at least one processor such that the playback device is configured to determine the n+1th instance of the adaptive filter for the next iteration of the AEC comprises comprises program instructions that are executable by the at least one processor such that the playback device is configured to:
- (i) estimate an nth frame of an error signal, the nth frame of the error signal representing a difference between the nth frame of the measured signal and the nth frame of the model signal;
- (ii) convert the nth frame of an error signal to an nth update filter;
- (iii) deactivate inactive portions of the nth update filter, the inactive portions having less than a threshold energy;
- (iv) generate the n+1th instance of the adaptive filter for the next iteration of the AEC by summing the nth instance of the adaptive filter with the nth update filter;
- and
- send the output signal as a voice input to one or more voice assistants for processing of the voice input.