I am trying to model an OFDM signal based on original QPSK stream and compare their baseband spectrums.
I've used this article as a reference for plotting spectrum and this as a MATLAB OFDM reference
Here are my signal presets
carsN = 8; % number of OFDM subcarriers
N=carsN*1024; % length of bits/symbols stream
m = 2; % Bits per symbol
M = 2^m;
Fb = 100; % PSK Bit (baud) rate, bps
Nsamp = 4;
Fs = Nsamp*Fb; % Sampling frequency, Hz
spb = Fs/Fb; % Samples per bit
I've used Nsamp=64
so I could have smoother spectrum plot.
Here is the rest of the code.
txsymbols = randi([0 M-1], N, 1); %generate symbols for QPSK
%%% PSK modulation
pskTxSig = pskmod(txsymbols, M,pi/M);
pskTxFilterOut = rectpulse(pskTxSig,32);
%%% OFDM modulation
pskSigOfdm = reshape(pskTxSig,carsN,[]); % reshape PSK signal, so it will have number or rows equal to number of subcarriers
OfdmTxSig = ofdmmod(pskSigOfdm,carsN,0);
OfdmTxFilterOut = rectpulse(OfdmTxSig,32);
sa1 = dsp.SpectrumAnalyzer(2, ...
Title="PSK & PSK-OFDM Signals with Rectangular Pulse Shaping", ...
ChannelNames={'PSK','OFDM'}, ...
SampleRate = Fs);
sa1(pskTxFilterOut ,OfdmTxFilterOut )
I've expected OFDM signal to have a spectrum similar to PSK, but more steep on its borders. But it seems to be the very very similar, but with lower amplitude (both on the mane lobe on side lobes. And "delay" between theese two plots is constant) .
I've also tried to divide and IFFT signal by my own:
txsym = zeros(size(txsymbols));
iffttemp = zeros(1,carsN);
for iter = 1:carsN:(N-carsN+1)
iffttemp = txSig(iter:(iter+carsNum-1));
txsym(iter:(iter+carsNum-1)) = ifft(iffttemp);
end
but had the same result.
Am I wrong in my model construction or in my assumptions about their spectrum? How can I assure it is OFDM signal after all?