A method in a radio network node for transmitting a reference signal over an antenna port, wherein the reference signal is transmitted in a code division multiplexing, CDM, group, the CDM group comprising two CDM subgroups, each CDM subgroup being transmitted on a different subcarrier, each CDM subgroup comprising resource elements, wherein the method comprises the steps of: - transmitting the reference signal over a first CDM subgroup using an orthogonal cover code, the first CDM subgroup comprising resource elements in a first time slot and a second time slot subsequent to the first time slot, - transmitting the reference signal over a second CDM subgroup using a permutation of the orthogonal cover code, the second CDM subgroup comprising resource elements in the first time slot and the second time slot; wherein the permutation of the orthogonal cover code is selected in such a way as to enable decoding of the reference signal in the frequency domain, by applying the orthogonal cover code only to resource elements in the CDM group which are comprised in the first time slot, and the first CDM subgroup is repeated an equal number of times as the second CDM subgroup over two resource blocks, wherein the method further comprising transmitting a second reference signal over a second antenna port in a second CDM group, the second CDM group comprising two CDM subgroups, each CDM subgroup being transmitted on a different subcarrier, each CDM subgroup comprising one or more resource elements, the method comprising the steps of: - transmitting the second reference signal over a third CDM subgroup using a second permutation of the orthogonal cover code, the third CDM subgroup comprising resource elements in the first time slot and the second time slot, - transmitting the second reference signal over a fourth CDM subgroup using the orthogonal cover code, the fourth CDM subgroup comprising resource elements in the first time slot and the second time slot; wherein the second permutation of the orthogonal cover code is selected in such a way as to enable decoding of the second reference signal in the frequency domain, by applying the orthogonal code only to resource elements in the second CDM group which are comprised in the first time slot, wherein the third CDM subgroup is repeated an equal number of times as the fourth CDM subgroup over two resource blocks, wherein the orthogonal cover code used in the third CDM subgroup is shifted compared to the orthogonal cover code used in the first CDM subgroup so that code elements in the first CDM subgroup and the third CDM subgroup in the first time slot or the second time slot contains all code elements comprised in each CDM subgroup in the first and second time slots, and wherein the third CDM subgroup is adjacent to the first CDM subgroup, and the fourth CDM subgroup is adjacent to the second CDM subgroup. - transmitting the reference signal over a first CDM subgroup using an orthogonal cover code, the first CDM subgroup comprising resource elements in a first time slot and a second time slot subsequent to the first time slot, - transmitting the reference signal over a second CDM subgroup using a permutation of the orthogonal cover code, the second CDM subgroup comprising resource elements in the first time slot and the second time slot; wherein the permutation of the orthogonal cover code is selected in such a way as to enable decoding of the reference signal in the frequency domain, by applying the orthogonal cover code only to resource elements in the CDM group which are comprised in the first time slot, and the first CDM subgroup is repeated an equal number of times as the second CDM subgroup over two resource blocks, wherein the method further comprising transmitting a second reference signal over a second antenna port in a second CDM group, the second CDM group comprising two CDM subgroups, each CDM subgroup being transmitted on a different subcarrier, each CDM subgroup comprising one or more resource elements, the method comprising the steps of: - transmitting the second reference signal over a third CDM subgroup using a second permutation of the orthogonal cover code, the third CDM subgroup comprising resource elements in the first time slot and the second time slot, - transmitting the second reference signal over a fourth CDM subgroup using the orthogonal cover code, the fourth CDM subgroup comprising resource elements in the first time slot and the second time slot; - transmitting the second reference signal over a third CDM subgroup using a second permutation of the orthogonal cover code, the third CDM subgroup comprising resource elements in the first time slot and the second time slot, - transmitting the second reference signal over a fourth CDM subgroup using the orthogonal cover code, the fourth CDM subgroup comprising resource elements in the first time slot and the second time slot;