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);

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?


1 Answer 1


You mustn't filter the output of your OFDM modulator with that rectpulse; that simply makes no sense. You're filtering a multicarrier signal with a single-carrier-bandwidth filter. To absolutely no surprise that gives you the spectral shape of the shaping filter, and you kill most of the information content.

Remember that for any random signal that is sufficiently white (especially: zero average), one of the very basic things you've been taught (probably!) is that the spectral shape is defined only, and really only, by the shape of that filter. You're using the same filter for your PSK single-carrier and for your OFDM signal, and hence, you get the same shape.

For OFDM, you do not filter the OFDM modulator's output (unless you're doing something that is advanced enough to contradict the textbook model of OFDM, which I kind of doubt you're doing here).

I've expected OFDM signal to have a spectrum similar to PSK, but more steep on its borders.

You really should not expect that! An OFDM modulator should generate sinc-shaped subcarriers.

Since this really seems to be a problem using Matlab's ofdmmod, which has no advantages here, I'd recommend you avoid that – and do OFDM like you've learned to, with ifft and manual insertion of guard interval or (better) cyclic prefix.

  • $\begingroup$ I've thought about that, but isn't its passband wide enough for OFDM signal? Also, it seems, that if I try to build spectrum of non-shaped signal, I get some white-noise-spectrum looking plot and not sinc. $\endgroup$
    – lazba
    May 24 at 4:15
  • $\begingroup$ again, exact same filter as PSK signal -> exact same spectrum. $\endgroup$ May 24 at 6:21
  • $\begingroup$ the white spectrum is what you should get within Nyquist, so that sounds about right. $\endgroup$ May 24 at 6:22
  • $\begingroup$ I see, the problem is in upsample+filter. If I apply rectpulse to ofdm output, I will get something more like PSK (or other pulse) signal. $\endgroup$
    – lazba
    May 24 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.