Techniques for extracting single-trial activity patterns from large-scale neural recordings