I derive and analyse an explicit formula for a generalized semblance attribute, which is suitable for the velocity analysis of prestack seismic gathers with distinct amplitude trends. While the conventional semblance can be interpreted as a squared correlation with a constant, the AB semblance is defined as a correlation with a trend. This measure is particularly attractive for analysing class II AVO anomalies and converted waves. Analytical derivations and numerical experiments show that the resolution of the AB semblance is approximately twice as low as that of the conventional semblance. However, this does not prevent it from being an effective attribute. I use synthetic and field data examples to demonstrate the improvements in velocity analysis from AB semblance.