Neural-Network-Based Energy Calculation for Multivoltage Threshold Sampling