The WQN algorithm to adaptively correct artifacts in the EEG signal