Optimal waveform design for array imaging