Energy per bit ($E_b$) in BPSK with non-unity channel gain I would like to know what is exact and correct definition of $E_b$ (energy per bit) in digital communication. Consider I have a model such as      r=a*x+n where a is the channel gain, x is a (+1 or -1) BPSK symbol and n is zero mean AWGN noise. I am defining $E_b$ to be (assuming a=10 and x given:

a=10;
Eb= sum((a*x).^2)/length(x);


However this method seems to be failing since $\sigma$ can be related to $E_b$ using $\sigma=\sqrt(E_b/(2*\text{SNR}))$. So if a is increased the noise power is increased as well and this should not be the case. Therefore should the definition of $E_b$ be like following:

   a=10;
   Eb= sum((x).^2)/length(x);


Meaning that is $E_b$ normalized to the a (channel gain). In this case then $E_b$ is 1 and as a increases the noise power won't be increasing. Can anyone elaborate on this? Should the noise power increases as the amplitude of signal increases? Then in this case performance gets worse and worse as signal amplitude is increased. Is this a correct statement?
The energy per bit $E_b$ means one thing and one thing only: how many joules is the transmitter spending, on average, per information bit transmitted. Note that the channel has absolutely nothing to do with $E_b$.

However, your question involves the SNR too. In a channel with non-unit gain, you need to decide where you'll measure the SNR.

You can define the SNR at the transmitter: $\text{SNR}=2E_b/N_0$ for BPSK. Obviously, the BER depends on both the SNR and the channel gain.

You can also define the SNR at the matched filter's output: $\text{SNR}=2G^2E_b/N_0$ for BPSK, for a channel with gain $G$. In this case, the BER depends exclusively on the SNR.

When $G$ is random with known probability density, it is common to average the SNR over $G$, in order to obtain the expected BER over many channel realizations.