Wow, thanks for the input!
Unfortunately, what you mention is hardly if at all implemented in the game. This, to me, is the biggest problem with the sonar: there is a huge number of factors that the sonar simply doesn't account for, at all. The best illustration is its ability to keep a solid 'lock' on you while another ship's depth charges are bursting all around the boat.
So, sad though it may be, most of the sonar fixes for a long time have been very abstract and having little to do with real detection except one thing: limiting the chances of enemy success to realistic values.