Lecture 5 · Signal Processing for Communications · University of Klagenfurt, 2019
Lecture 5 of 7
From Signal Processing for Communications at the University of Klagenfurt, which I taught in winter 2019: this is that edition, rebuilt for the web, so some of it may be a little dated. All lectures.
01
The channel is often modelled as a linear time-invariant filter, and the noise as an additive component.
x(t) h_M(t) + w(t) y(t)
The output is
y(t)=x*h_M(t)+w(t)
In wireless, the channel can be modelled as a number of rays, each with its own gain and delay,
h_M(t)=\sum_p\alpha_p\,\delta(t-t_p)
The noise w(t) is assumed to be Gaussian.
Assumptions:
Depending on h_T(t), there are three types of linear modulation:
\tilde x(t) h_{LP}(t) x(t) \times \cos(2\pi f_0t+\phi_0) x_1(t) h_T(t) x_2(t)
transmitter
x_2(t) h_M(t) + w(t) x_3(t)
channel
x_3(t) h_R(t) y(t) \times \cos(2\pi f_0t+\phi_1) z(t) q(t) \hat x(t)+n_R(t)
receiver
The low-pass h_{LP} limits the message to (-B,B); q(t) is a low-pass filter on the same band. The output is the useful signal \hat x(t) plus the noise n_R(t).
The performance is measured by the signal to noise plus distortion ratio; when the distortion is zero, it is the signal to noise ratio (SNR):
\Lambda=\frac{M_{su}}{M_d+M_{n_R}}
where
d(t)=\hat x(t)-k\cdot x(t)
Find the value of k for which M_d is minimized when \hat x(t)=k\cdot x(t)+d(t). (Example 1)
For jointly stationary real x and \hat x, the distortion power is a parabola in k:
M_d(k)=E\left[\left(\hat x(t)-k\,x(t)\right)^2\right]=M_{\hat x}-2k\,r_{\hat xx}(0)+k^2M_x
\frac{dM_d}{dk}=-2r_{\hat xx}(0)+2kM_x=0\ \Rightarrow\ k=\frac{E\left[\hat x(t)\,x(t)\right]}{E\left[x^2(t)\right]}=\frac{r_{\hat xx}(0)}{M_x}
With this k,
M_{d,\min}=M_{\hat x}-\frac{r_{\hat xx}^2(0)}{M_x},\qquad E\left[d(t)\,x(t)\right]=0
The distortion is the part of \hat x orthogonal to x: what is left after the best scaled copy of the message has been taken out.
My notes have no solution to this one: it is added for the web version.
02
Every band-pass block has a baseband equivalent: the modulator multiplies by e^{j\phi_0}, each filter h acts as \frac12h^{(bb)}, and the demodulator with q(t) keeps \mathrm{Re}\left\{\frac12\,\cdot\,e^{-j\phi_1}\right\}.
x^{(bb)}(t) \times e^{j\phi_0} \frac12h_T^{(bb)}(t) \frac12h_M^{(bb)}(t) + w^{(bb)}(t)
\frac12h_R^{(bb)}(t) \times \frac12e^{-j\phi_1} q(t) \mathrm{Re}\{\cdot\} \hat x(t)+n_R(t)
In DSB, h_T, h_M and h_R pass the band (f_0-B,f_0+B) with gains A_T, A_M, A_R. The phase offset between modulator and demodulator is
\Delta\phi=\phi_0-\phi_1
\hat x(t)=\mathrm{Re}\left\{x(t)\cdot e^{j\phi_0}\cdot A_TA_MA_R\cdot\tfrac12e^{-j\phi_1}\right\}=\tfrac12A_TA_MA_R\cos(\Delta\phi)\,x(t)
M_{n_R}=\frac{N_0}{4}\cdot A_R^2\cdot2B,\qquad \Lambda=\frac{\frac14A_T^2A_M^2A_R^2\cos^2(\Delta\phi)\cdot M_x}{\frac{N_0}{4}\cdot A_R^2\cdot2B}=\frac{A_T^2A_M^2\cos^2(\Delta\phi)\cdot M_x}{N_0\cdot2B}
The signal is a scaled copy of x, so M_d=0 and M_{su}=\frac14A^2\cos^2(\Delta\phi)M_x, with A=A_TA_MA_R (the DSB system of lecture 4).
The noise is white, \frac{N_0}{2}, filtered by h_R: n=h_R*w. By the band-pass noise example of lecture 4, its in-phase and quadrature components each have power 2N_0A_R^2B, and they are uncorrelated. The receiver keeps one rotated component, halved:
n_R(t)=\mathrm{Re}\left\{\tfrac12\,n^{(bb)}(t)\,e^{-j\phi_1}\right\}\ \Rightarrow\ M_{n_R}=\tfrac14\cdot2N_0A_R^2B=\frac{N_0}{4}A_R^2\,2B
The results are on my slides; the derivation is added for the web version.
The same chain, with an SSB transmission filter. Take the upper sideband: h_T and h_R pass (f_0,f_0+B), so \frac12h_T^{(bb)} keeps only the positive mode X^+ of the message.
x^{(bb)}(t) \times e^{j\phi_0} \frac12h_T^{(bb)}(t) \frac12h_M^{(bb)}(t) + w^{(bb)}(t)
\frac12h_R^{(bb)}(t) \times \frac12e^{-j\phi_1} q(t) \mathrm{Re}\{\cdot\} \hat x(t)+n_R(t)
\begin{aligned}\hat x(t)&=\mathrm{Re}\left\{x^+(t)\cdot e^{j\phi_0}\cdot A_TA_MA_R\cdot\tfrac12e^{-j\phi_1}\right\}=\mathrm{Re}\left\{\tfrac14x^{(a)}(t)\cdot e^{j\phi_0}\cdot A_TA_MA_R\cdot e^{-j\phi_1}\right\}\\&=\tfrac14A_TA_MA_R\cdot x(t)\cos(\Delta\phi)-\tfrac14A_TA_MA_R\cdot x_H(t)\sin(\Delta\phi)\end{aligned}
M_d=\tfrac{1}{16}A_T^2A_M^2A_R^2\sin^2(\Delta\phi)\cdot M_x,\qquad M_{n_R}=\frac12\,\frac{N_0}{4}\cdot A_R^2\cdot2B
\Lambda=\frac{\frac{1}{16}A_T^2A_M^2A_R^2\cos^2(\Delta\phi)\cdot M_x}{\frac{N_0}{8}\cdot A_R^2\cdot2B+\frac{1}{16}A_T^2A_M^2A_R^2\sin^2(\Delta\phi)\cdot M_x}
With x^{(a)}=x+jx_H, the real part gives the second line. Since E[x\,x_H]=0 and M_{x_H}=M_x, the optimal gain is k=\frac A4\cos(\Delta\phi) and the distortion is the x_H term. The noise now fills a band of width B on each side, half the DSB one, so M_{n_R} is half the DSB value. A phase error does not just lower the gain, as in DSB: it leaks the Hilbert transform into the output.
The results are on my slides; the derivation is added for the web version.
Write a Matlab function to simulate the SSB modulation scheme, with the structure
function y = SSB(x, B, Fc, dphi)
where x is the real input signal, B the bandwidth of the transmission filter h_T(t), Fc > B the carrier frequency, dphi the phase offset \Delta\phi=\phi_0-\phi_1 of the modulator and demodulator, and y the output signal.
For simplicity, consider the medium and the receiver to be ideal filters with amplitude A_M=A_R=1. Lastly, given x and y, write a function to compute the Hilbert transform x_H(t):
function x_h = Hilbert(x, y)
The sampling frequency must hold the whole modulated band: F_s>2(F_c+B). Take A_T=1, \phi_1=0 and \phi_0=\Delta\phi. From the SSB result,
y(t)=\tfrac14\left[x(t)\cos(\Delta\phi)-x_H(t)\sin(\Delta\phi)\right]
For the Hilbert transform, use the optimal gain of Example 1. Since x and x_H are orthogonal,
k=\frac{\langle y,x\rangle}{\langle x,x\rangle}=\tfrac14\cos(\Delta\phi),\qquad d=y-kx=-\tfrac14\sin(\Delta\phi)\,x_H
and, as M_{x_H}=M_x,
x_H=-\frac{d}{\frac14\sin(\Delta\phi)}=-d\,\sqrt{\frac{M_x}{M_d}}\qquad(0<\Delta\phi<\pi)
The distortion is all we need: it is the Hilbert transform, scaled. It vanishes for \Delta\phi=0 or \pi, and then x_H cannot be recovered from y. If \Delta\phi is known, simply x_H=\frac{x\cos(\Delta\phi)-4y}{\sin(\Delta\phi)}.
My notes have no solution to this one: it is added for the web version.
function y = SSB(x, B, Fc, dphi, fs)
N = length(x); t = (0:N-1)/fs; % N even
f = (-N/2:N/2-1)*fs/N;
x1 = x .* cos(2*pi*Fc*t + dphi); % modulator, phi_1 = 0
HT = double(abs(f) > Fc & abs(f) < Fc + B); % upper sideband
x2 = real(ifft(ifftshift(HT .* fftshift(fft(x1)))));
z = x2 .* cos(2*pi*Fc*t); % demodulator
HL = double(abs(f) < B);
y = real(ifft(ifftshift(HL .* fftshift(fft(z)))));
end
function x_h = Hilbert(x, y)
k = (y*x.')/(x*x.'); d = y - k*x; % optimal gain
x_h = -d * sqrt((x*x.')/(d*d.')); % assumes sin(dphi) > 0
endA sketch with ideal filters in the frequency domain; it needs the sampling frequency fs as an extra argument, with fs > 2*(Fc+B). Expect y to be the message scaled by \frac14\cos(\Delta\phi) plus the leaked x_H, and x_h to match Matlab’s imag(hilbert(x)).
This sketch is added for the web version. My own draft for this assignment has a bug: it samples at 200 Hz with a 100 Hz carrier, so the upper sideband aliases, and its frequency grid does not match the FFT bins. Its output is close to the input, not to its Hilbert transform.
Two real messages a(t) and b(t), both with spectral extension (-B,B), share one carrier f_0>B: one on the cosine, one on the sine.
a(t) \times \cos(2\pi f_0t+\phi_0) + the two branches s(t)
b(t) \times -\sin(2\pi f_0t+\phi_0) into the same adder
s(t) h_T(t) h_M(t) + w(t) h_R(t) \tilde s(t)
\tilde s(t) \times \cos(2\pi f_0t+\phi_1) q(t) \tilde a(t)
\tilde s(t) \times -\sin(2\pi f_0t+\phi_1) q(t) \tilde b(t)
In the quadrature modulation system, the signals a(t) and b(t) are real with spectral extension \varepsilon=(-B,B), the carrier frequency is f_0>B, and the filters h_T, h_M, h_R are ideal on (f_0-B,f_0+B), with gains A_T, A_M, A_R.
Find the expressions of the output signals \tilde a(t) and \tilde b(t), without noise.
With c(t)=a(t)+j\,b(t), the transmitted signal is s(t)=\mathrm{Re}\left\{c(t)\,e^{j\phi_0}e^{j2\pi f_0t}\right\}, and through the ideal filters \tilde s^{(bb)}=A\,c\,e^{j\phi_0}, with A=A_TA_MA_R. For low-pass u and v, the product followed by q keeps q\left[\mathrm{Re}\{ue^{j\theta}\}\,\mathrm{Re}\{ve^{j\theta}\}\right]=\frac12\mathrm{Re}\{uv^*\}, and -\sin(\theta+\phi_1)=\mathrm{Re}\left\{j\,e^{j(\theta+\phi_1)}\right\}:
\tilde a(t)=\tfrac12\mathrm{Re}\left\{A\,c\,e^{j\Delta\phi}\right\}=\tfrac12A_TA_MA_R\,a(t)\cos(\Delta\phi)-\tfrac12A_TA_MA_R\,b(t)\sin(\Delta\phi)
\tilde b(t)=\tfrac12\mathrm{Im}\left\{A\,c\,e^{j\Delta\phi}\right\}=\tfrac12A_TA_MA_R\,b(t)\cos(\Delta\phi)+\tfrac12A_TA_MA_R\,a(t)\sin(\Delta\phi)
A phase error rotates the pair (a,b): each output picks up a part of the other message, a crosstalk.
The result is on my slides; the derivation is added for the web version.
c(t) \times e^{j\phi_0} \frac12h_T^{(bb)}(t) \frac12h_M^{(bb)}(t) + w^{(bb)}(t)
\frac12h_R^{(bb)}(t) \times \frac12e^{-j\phi_1} q(t) \tilde c(t)+\tilde n(t)
If c(t)=a(t)+j\,b(t), then
\tilde c(t)=\tilde a(t)+j\,\tilde b(t)=\tfrac12A_TA_MA_R\cdot c(t)\cdot e^{j\Delta\phi}
M_{\tilde n_I}=M_{\tilde n_Q}=\frac{N_0}{4}\cdot A_R^2\cdot2B,\qquad M_{\tilde n_I\tilde n_Q}=0
Each branch has the noise power of DSB, and the two noises are uncorrelated: \tilde n=\frac12n^{(bb)}e^{-j\phi_1} is a rotation of a baseband noise with uncorrelated components of equal power, and a rotation keeps both properties. Quadrature modulation sends two messages in the band of one.
03
In amplitude modulation (AM), the amplitude of the carrier varies in proportion to the message s(t):
v(t)=\left[V_0+K_I\cdot s(t)\right]\cos(2\pi f_0t+\varphi),\qquad a(t)=V_0+K_I\cdot s(t)\ge0
The modulation index is
m_I=\frac{K_I\cdot s_M}{V_0}\le1,\qquad s_M=-\min\left(s(t)\right)
the message s(t)=\frac{t}{t^2+1} in DSB and in AM, with V_0=K_I=1 and f_0=1: the AM envelope never crosses zero (m_I=\frac12)
Compute the power and the spectrum of the AM signal
v(t)=\left[V_0+K_I\cdot s(t)\right]\cos(2\pi f_0t+\varphi)
where the message s(t) has zero mean, power M_s and band B<f_0.
The power of a band-pass signal is half the power of its envelope, and the zero mean of s removes the cross term:
M_v=\tfrac12\left(V_0^2+K_I^2M_s\right)=\tfrac12\left(V_0^2+K_I^2\cdot K_F^2\cdot s_M^2\right)=\tfrac12V_0^2\left(1+m_I^2\cdot K_F^2\right),\qquad K_F=\sqrt{\frac{M_s}{s_M^2}}
where K_F is the form factor of the message. The spectrum is the message shifted to \pm f_0, plus the carrier lines:
V(f)=\tfrac{V_0}{2}\left[e^{j\varphi}\delta(f-f_0)+e^{-j\varphi}\delta(f+f_0)\right]+\tfrac{K_I}{2}\left[e^{j\varphi}S(f-f_0)+e^{-j\varphi}S(f+f_0)\right]
R_v(f)=\tfrac{V_0^2}{4}\left[\delta(f-f_0)+\delta(f+f_0)\right]+\tfrac{K_I^2}{4}\left[R_s(f-f_0)+R_s(f+f_0)\right]
The band is 2B, as in DSB, and the carrier takes power without carrying the message.
The power is on my slides; the spectrum is added for the web version.
AM needs no carrier phase at the receiver: a very simple component that detects the envelope is the diode, followed by a low-pass filter.
v(t) diode v(t)\cdot1(v(t)) q(t) \frac1\pi a(t)
With a(t)\ge0, the diode output is a(t) times a half-wave rectified cosine, whose mean is \frac{1}{2\pi}\int_{-\pi/2}^{\pi/2}\cos\theta\,d\theta=\frac1\pi; the low-pass filter keeps only that term, \frac1\pi a(t). This is why AM asks for m_I\le1.
The result is on my slides; the derivation is added for the web version.
For what concerns the efficiency of the AM scheme,
\Lambda=\Lambda_c\cdot\frac{m_I^2\cdot K_F^2}{1+m_I^2\cdot K_F^2},\qquad\Lambda_c=\frac{M_R}{\frac{N_0}{2}\cdot2B}
where M_R is the power of the received modulated signal and \Lambda_c the reference SNR, the one of a baseband transmission with the same received power.
The fraction \frac{m_I^2K_F^2}{1+m_I^2K_F^2} is the share of the power that carries the message: the rest goes to the carrier. For a sinusoidal message, K_F^2=\frac12, and even at m_I=1 it is only one third.
In argument modulation, the message to send appears inside the argument of the carrier:
v(t)=V_0\cos\left(2\pi f_0t+\varphi_0+\alpha(t)\right)
Phase modulation (PM):
\alpha(t)=K_\varphi\cdot s(t)
the phase deviation is proportional to the message. With a message of band B, the bandwidth is
B_v\approx2B\left(1+\Delta\varphi_{\max}\right)
Frequency modulation (FM):
\alpha(t)=2\pi K_f\int_{t_0}^{t}s(u)\,du
the frequency deviation is proportional to the message. With a message of band B, the bandwidth is
B_v\approx2\left(B+\Delta F_{\max}\right)
\Delta\varphi_{\max} and \Delta F_{\max} are the maximum absolute values of the phase and of the frequency deviation (Carson’s rule).
Carson’s rule on a sinusoidal message: B=1 Hz and \Delta\varphi_{\max}=5, so B_v\approx2\cdot1\cdot(1+5)=12 Hz.
No saved run survives. What to expect: a carrier of constant envelope whose zero crossings bunch and spread once per second; a spectrum of lines 1 Hz apart around F_c=10 Hz, nearly all of the power between 4 and 16 Hz.
plot(abs(V)) draws against the FFT bin index, without fftshift: to read the axis in hertz, plot against (0:N-1)/(N*0.001).
Next: Lecture 6, quantization
letizia.tech · Signal Processing for Communications · University of Klagenfurt