Optimum Wavelet Design for Transient Detection