A)Wave hand < 10in change Channel Up
B)Wave hand > 10in change Channel Down
C)Hold hand at < 10in Volume Up
D)Hold hand at > 10in Volume Down
E)Hold hand at < 3 in Power Up/Down TV
Of course you have to change the IR codes depending on your tv, but other than that Larry explains his code very well.
Arduino Code : https://www.dropbox.com/s/f0gd9pqf148o1g8/control_tv_with_ultrasonic.ino?dl=0