Generalized detector as a spectrum sensor in cognitive radio networks