Self-Sustaining Acoustic Sensor with Programmable Pattern Recognition for Underwater Monitoring