# Time and frequency domain spreading in CDMA and MC-CDMA?

For time domain CDMA transmitter, how the spreading sequences should look like? Is it necessary to be from $\{ -1,+1\}$ like PN sequences ? How will the codes be in frequency domain?
I am confused in spreading codes used for MC-CDMA and CDMA.
If I use a PN sequence $\in \{ -1,+1\}$ and then take FFT, it is MC-CDMA.
Now, If I directly use a DFT matrix as spreading codes, is it equivalent to MC-CDMA?

• PN sequences generally take on values in $\{+1, -1\}$ and not in $\{+1, 0, -1\}$. – Dilip Sarwate Apr 4 '17 at 15:43
• Note some interesting similarities between OFDM and CDMA: OFDM can be viewed as spreading with symbols that are the complex roots of unity just like forms of CDMA done with spreading with Walsh Codes (symbols that are +1/-1). In 2 points they converge to the same spreading matrix ([1 1; 1 -1]), so in that sense OFDM is in itself a form of CDMA! But MC-CDMA specifically is a system of using the user's spread data (with PN sequences consisting of +/-1 and assigning each chip in the sequence to a different subcarrier before taking the IFFT to create the transmit waveform (as in OFDM) – Dan Boschen Apr 4 '17 at 16:12

The spectrum of DS-CDMA without pulse shaping is equivalent to the sinc function. The Matlab code below illustrates the difference between DS and MC-CDMA. For MC you need the IFFT not the FFT function.

clear,clc

N=2;
% BPSK data
d=sign(randn(1,N));

% 7-chip m-sequence code
c=[1 1 1 -1 1 -1 -1];

% DS-CDMA
s1=kron(d,c);

% MC-CDMA
L=sqrt(length(c));
s2=L*ifft(d(1)*c);
s3=L*ifft(d(2)*c);
% etc, better to use a for loop for more symbols