4G/LTE - LTE NB
NRS(NB Reference Signal)
As in legacy LTE, LTE-NB also transmit cell specific reference(CRS) signal called NRS. The sequence (data) is generated in a very similar way to legacy LTE, but RE mapping (the position in resource map) is a little bit modified in such way that NRS does not overwriting legacy LTE CRS).
The signal generation method (formula) for NRS (LTE-NB) is same as RS(LTE) except the Cell ID parts as indicated below. If you are really interested and motivated, you may try writing a small program (in C, Matlab or whatever you are familiar with) to generate these sequence. Once you really tried this, you would understand the meaning of each of these parameters even though the resulting data itself is not 100% accurate. Just trying would give you much deeper understanding. The most tricky part of generating this sequence would be to implement the pseudo random sequence(c()). LTE Psuedo Random Sequence would help you on this.
RE(Resource Element) Mapping
The location of NRS (LTE-NB Reference Signal) is as shown below. It has two different pattern, one for Single Antenna mode and the other one for two antenna mode. You may refer to 36.211-10.2.6.2 for formal description.
The Resource Map shown above is just an example. The exact location would vary slighly depending on LTE NB Physical Cell ID and following equation. If you look into this very carfully, you would notice that the time domain location for NRS does not change, but frequency domain location varies with parameters m, v and v_shift. m varies between 0 and 1. v varies with antenna port number and v_shift varies with Physical Cell ID. It means that the reference signal position in frequency domain would vary depending on Physical Cell ID(PCI). To be more accurate, the frequency location of NRS shifts by 1 as PCI increments by 1, but after the shift cycle through 6 RE(Resource Element) in frequency domain. This is same logic as in legacy LTE.