TLT-5400/5406 DIGITAL TRANSMISSION, 3rd Matlab-Exercise: Mapping Transmit Filter R
TLT-5400/5406 DIGITAL TRANSMISSION, 3rd Matlab-Exercise: Mapping Transmit Filter R
In previous exercises, we have considered digital PAM transmission from the baseband signaling point of view.
However, only few practical communications channels bear transmission of baseband signals. Most physical
transmission media are incapable of transmitting frequencies at DC or near DC. Translating the frequency spectrum of a
baseband signal to the frequency range tolerated by a particular channel is simple in principle. In this exercise, we
consider complex (I/Q) modulated bandpass signals and three different approaches for downconversion/demodulation.
In this exercise, you should understand and learn bandpass transmission and I/Q up- and downconversion principles.
Basic theoretical introduction may be found in course handbook (3rd ed.) Chapter 6.4, starting from page 167.
The principle of a bandpass I/Q (QAM, PSK, etc.) transmitter is given in Figure 1.
QAM
e jwct
BITS TRANSMIT r
MAPPING RE{.}
COMPLEX FILTER COMPLEX COMPLEX REAL
SYMBOLS BASEBAND PASSBAND PASSBAND
SIGNAL SIGNAL SIGNAL
Figure 1. A bandpass I/Q transmitter.
Symbol Sequence
The first step in this exercise is the generation of a random 16-QAM symbol sequence. The QAM alphabet is generated
first, and after that symbol sequence by “random indexing”.
• QAM-signal consists of symbol elements a+j*b, where a, b = {..., -3, -1, 1, 3 , ...}
Let’s generate a 16-QAM symbol sequence of 2000 symbols and plot the constellation:
M = 4; % M^2-QAM
temp_M = -(M-1):2:(M-1); % generate QAM Alphabet, one possibility (or see the earlier
for i=1:M % exercises for alternative implementations)
for k = 1:M
QAM(i,k) = temp_M(i) + j*temp_M(k);
end
end
QAM = QAM(:).'; % alphabet vector
index = randint(1,2000,[1 M^2]);
sym = QAM(index); % random QAM symbol sequence
Next the symbol sequence must be upsampled by 16 before filtering (it must have the same sampling rate as the filter).
sig = kron(sym,[1 zeros(1,over-1)]); % adding over-1 zeros between the symbols, see help kron
sig = filter(pulse,1,sig); % signal after pulse shaping (baseband waveform)
sig = sig(pos:end); % discard transient
pp. 1 (3)
Carrier (I/Q) Modulation
The role of carrier modulation is frequency translation. Modulating a complex baseband signal with a complex
exponential yields a complex-valued analytic bandpass signal. Since physical media accept only real-valued signals,
only the real part of the signal is transmitted (which indeed contains all the information of the original complex
baseband signal).
w_c = 0.4; % carrier frequency, normalized here to half the sampling rate
r = 2*real(sig.*exp(j*w_c*pi*(0:length(sig)-1))); % bandpass signal
figure(2);plot(r(1:800));grid; % plot a piece of the bandpass signal
It is very illustrative to examine the spectra of these signals. The idea is to use one figure and subplot command in order
to see and understand the process of downconversion and filtering. The modulated signal spectrum is obtained by the
following set of commands, the same set can be used later to show the signal spectra at different stages.
Bandpass Receivers
We will simulate three different bandpass receivers. Each of them has some kind of filtering and I/Q downconversion.
e − jwct
r LOWPASS BITS
SAMPLER DETECTOR DECODER
FILTER
REAL
PASSBAND COMPLEX COMPLEX COMPLEX
SIGNAL BASEBAND SAMPLES SYMBOLS
SIGNAL
Figure 2. The principle of bandpass receiver using I/Q downconversion and lowpass filtering.
− jω t
The principle of this receiver is given in Figure 2. After the signal is I/Q downconverted by multiplying by e c ,
it is filtered with a lowpass filter (What is/are the role(s) of this lowpass filter in general?). LPF design using the
remez routine in Matlab, (see help remez).
f = remez(50,[0 0.2 0.3 1],[1 1 0 0]); % design of the receiver lowpass filter, order 50
F = freqz(f,1,W); % frequency response of the filter
hold on;
plot(W/pi,abs(F),'r','LineWidth',2);
hold off;
Finally, the spectrum of the demodulated baseband signal and the corresponding constellation are plotted (this part
below is the same for all the three methods, thus it will not be repeated in these instructions every time).
pp. 2 (3)
Y = freqz(y(1000:2023),1,W); % spectrum of the signal at this stage
Y = Y./max(abs(Y)); % normalize the spectrum for plotting
figure(3);subplot(212);plot(W/pi,abs(Y));grid;
axis([-1 1 0 1.1]);
figure;
plot(y(1+over:over:end),'*','MarkerSize',8); % downsampling
axis([-4 4 -4 4]);grid;
In this case the signal is filtered prior to the downconversion. The needed analytic bandpass filter is obtained by
modulating the lowpass prototype filter which is obtained from the previous case. Notice that the filter coefficients
become complex in this case. After the signal is filtered, it is I/Q downconverted and detected.
f = remez(50,[0 0.2 0.3 1],[1 1 0 0]); % filter design, order 50, low pass prototype
f2 = f.*exp(j*w_c*pi*(0:length(f)-1)); % complex bandpass filter (analytic), modulated coefficients
pos = 26; % delay of the filter
A conceptually useful filter for the manipulation of bandpass signals is the ideal phase splitter. It has the effect of
eliminating the negative frequency components of a bandpass signal. As in the previous case, also the phase splitter
has a complex-valued impulse response. If its input is real, it can be implemented with two real-valued filters. The
real part of the phase splitter impulse response is here a pure delay and the imaginary part is a Hilbert transformer.
The Hilbert transformer can be designed using the remez routine directly, see help remez. The part of receiver after
this filter is identical to the previous case (case (b)). Thus, the Matlab code is the same.
The part of the receiver after this filter is the same as in the previous case. Thus, the Matlab code is the same for
b) and c) and it is given below.
This is followed by the code in the dashed box (top of the page) which simply plots the baseband spectrum and the
corresponding constellation.
pp. 3 (3)