How to identify and remove a looping sound?
Hard to say what could cause this problem. 
Maybe you're able to tell what happened before the sound started? Could be a hint to address the issue.

I would recommend start with uninstalling any unecessary apps and going through every app that is/was ever generating notifications for you. Check their internal settings (if there are any) and also check notification settings in app manager. 

If you're using developer mode I suppose you can also try to turn it off, just in case.

If it's reacting on shake in a weird way I'd also recommend to run all possible updates, alternatively reinstall apps or in the worst case: reinstall the system. Can't tell more about what could cause the bug.