# channel gain calculation

I want to calculate the SINR term in an up-link of wireless communication system but there is different models for simulation. I want to know what is the exact meaning of $$|h|^2$$ in this formula:

$$\text{SINR} = \frac{p|h|^2}{\text{Interference+Noise}}$$

Is this a Rayleigh fading envelop? If yes, what about path loss? Isn't any difference between near and far users? How can I simulate the channel gains correctly? Thanks

In your definition of the SINR, $$h$$ is the channel coefficient. What it means is this: if we send a signal $$x(t)$$ and model our channel as stationary and frequency-flat then the signal we receive is $$y(t) = h \cdot x(t)$$ (plus noise) so that its power is $$P_y = E\{|y|^2\} = |h|^2 \cdot P_x$$. This is why $$|h|^2$$ appears in your SINR expression: the channel coefficient scales your received signal and therefore $$|h|^2$$ scales your received power.
Now, in practice, $$h$$ would contain all the effects that can happen to a signal: (free-space) path loss where $$h$$ is proportional to $$1/d$$ where $$d$$ is the distance (near/far users); small-scale fading, where $$h$$ varies rapdily so it's best described statistically (e.g., via a Complex Gaussian, which then leads to $$|h|$$ being Rayleigh distributed); shadowing which can be modeled as a slow variation of the variance of $$|h|^2$$, e.g., via a log-normal distribution; and more.
Whenever you start modeling $$h$$ randomly, your received SINR will become a random variable as well. This makes sense though: when you're in a fade, you have little power and as soon as you drop out of it, your power is back to being high. You can then look at statistical moments of the SINR or the quantities derived from it (such as the capacity, leading to things like ergodic and outage capacity, respectively.