Electron counting detectors in scanning transmission electron microscopy via hardware signal processing