In cognitive radio networks, the channel gain between primary transceivers, namely, primary channel gain, is crucial for a cognitive transmitter (CT) to control the transmit power and achieve spectrum sharing. Conventionally, the primary channel gain is estimated in the primary system, and thus unavailable at the CT. To deal with the issue, two estimators are proposed by enabling the CT to sense primary signals. In particular, by adopting the maximum likelihood (ML) criterion to analyze the received primary signal, an ML estimator is first developed. To reduce the computational complexity of the ML estimator, a median-based (MB) estimator is then proposed. By comparing the ML estimator and the MB estimator from the aspects of the computational complexity as well as the estimation accuracy, both advantages and disadvantages of two estimators are revealed. Simulation results show that the estimation errors of both estimators can be as small as 0.015. Meanwhile, the ML estimator outperforms the MB estimator in terms of the estimation accuracy if the sensed primary signal at the CT is weak. Otherwise, the MB estimator is superior to the ML estimator from the aspects of both the computational complexity and the estimation accuracy.