A novel discrete Gabor transform (DGT) with a weighted linear combination of analysis windows is presented, which can utilise the optimal weights to change the shape and width of the combined analysis window so as to improve the time–frequency resolution of the Gabor spectrum. The optimal weights can be solved by minimising the objective function with the mixed ℓ1 and ℓ2 norms of the DGT coefficients, which leads to the maximum time–frequency concentration of energy on the time–frequency plane, or equivalently, the optimal time–frequency resolution. Experimental results show that the proposed DGT is highly effective in time–frequency analysis.