Limited memory optimal filtering