Method for optimization of transmitted and received ultrasound pulses, particularly for ultrasonic imaging