Professional Documents
Culture Documents
o
=
s
2
m
N
o
/2
=
2E
b
N
o
= 2
where s
2
m
= E
b
and = E
b
/N
o
. Then, the bit error probability can be shown as
P
b
= Q
_
_
2
_
Frequency Error Case:
Now consider the receiver with frequency error, f
e
, which may be caused by the heat or imperfection of the
oscillator. Then even though the receiver set the oscillator to generate the frequency f
c
, it will generate the
frequency f
c
+ f
e
so (3) can be written as
y(t) =
_
T
0
r(t)
2
E
g
g(t) cos 2(f
c
+ f
e
)t dt
= s
m
_
T
0
2
E
g
_
T
0
g
2
(t) cos(2f
c
t) cos(2(f
c
+ f
e
)t) dt + z(t), (2)
where we can easily show that z(t) is Gaussian random process with zero mean and N
o
/2 variance (Why?).
Assuming the rectangular pulse for g(t), we can write (2) as
y(t) = s
m
_
T
0
2 cos(2f
c
t) cos(2(f
c
+ f
e
)t) dt + z(t)
= s
m
_
T
0
[cos(2f
e
t) + cos(2(f
c
+ f
e
)t)] dt + z(t)
= s
m
sin(2f
e
T)
2f
e
+ z(t) (3)
7
Now the output SNR for the carrier frequency error is given as
f
e
=
2E
b
_
sin(2f
e
T)
2f
e
_
2
N
o
= 2
_
sin(2f
e
T)
2f
e
_
2
and thus its BER can be written as
P
b
= Q
_
sin(2f
e
T)
2f
e
_
2
_
In Matlab, we can check the effect of frequency error on the BER performance by running the following m-le and its
result is given in Fig. 5.
snrdB=[0:0.1:15];
snr=10.(snrdB./10);
T=1;
a=[0.1 0.2 0.3];
a=sin(2
*
pi
*
a
*
T)./(2
*
pi
*
a);
pb0=Qfunct(sqrt(2
*
snr));
pb1=Qfunct(sqrt(2
*
snr)
*
abs(a(1)));
pb2=Qfunct(sqrt(2
*
snr)
*
abs(a(2)));
pb3=Qfunct(sqrt(2
*
snr)
*
abs(a(3)));
semilogy(snrdB,pb0,-,snrdB,pb1,--,snrdB,pb2,:,snrdB,pb3,.)
grid on xlabel(\gamma [dB]) ylabel(BER)
legend(f_eT=0,f_eT=0.1,f_eT=0.2,f_eT=0.3)
axis([0 15 10(-8) 1])
1 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 1
0.25
0.2
0.15
0.1
0.05
0
0.05
0.1
0.15
0.2
0.25
f
e
T (True Value) [Hz]
E
s
t
i
m
a
t
e
d
V
a
l
u
e
[
H
z
]
Figure 5: Effect of frequency error for T = 1 sec and f
e
T = 0, 0.1, 0.2, and 0.3.
As seen in this gure, there are signicant performance loss due to the frequency error. For example, if T = 1 ms
and the frequency error is f
e
= 100, 200, and 300 Hz, which correspond to f
e
T = 0.1, 0.2, and 0.3, the performance
loss to reach 10
3
BER, comparing to no frequency error, is approximately 0.5 dB, 2.5 dB, and 7 dB, respectively
8
4 Estimation of Frequency Error
For the estimation of frequency error, there are mainly two different schemes: one is non-data aided scheme and the
other is data-aided scheme. In our lab, we only consider the non-data aided scheme where the pilot signal is used for
the frequency error.
Pilot Signals: The pilot signal is known signal at the receiver. For example, the transmitter transmits the signal
for the symbol duration T as
s(t) = [Ag(t)e
j2f
c
t
],
where A is a complex constant value and g(t) is the pulse dened for 0 t T. In practical communication
systems, the pilot signal is transmitted for the channel estimation, frequency error estimation, timing error
estimation, etc.
Estimation over noiseless channels:
Let us consider noiseless case only to see the effect of frequency error. Then, at the receiver, employing the
correlation based demodulator, we have its sampled output signal with the sampling period of T as
y(nT) = [ y(nT)]
= [Ae
j2f
e
nT
]
= A
I
cos(2f
e
nT) A
Q
sin(2f
e
nT) (4)
where y(nT) is the complex representation of y(nT), that is, y(nT) = Ae
j2f
e
nT
, A = A
I
+ jA
Q
. Note
that A
I
and A
Q
are known to the receiver and thus
A
is also known. Without loss of generality and for the
simplicity, let us assume that A
I
=
P and A
Q
= 0. Consider the following discriminator as
d(n) = y
Pe
j2f
e
T
,
where is the conjugate operation.
Then, we can estimate f
e
by
f
e
=
tan
1
__
Quadrature term of d(n)
In-phase term of d(nT)
__
2T
Simulation: In Matlab, we can simulate the estimation of f
e
using the complex signal. We rst want to see the
various values of f
e
such as f
e
= [1/T : 0.1/T : 1/T] with T = 1 sec. Then, its result is illustrated in Fig. 6.
Note that Fig. 6 is called the S-curve. Why is it periodic? What is the bound of the frequency error in Hz that
your atan based estimator can estimate? You have to answer these questions!
N=1;
P=1;
j=sqrt(-1);
A=sqrt(P)
*
ones(1,N); % unit energy.
T=1; % symbol duration
fe=[-1/T:0.1/T:1/T]; % [Hz]
dnT= A.
*
exp(j
*
2
*
pi
*
fe
*
T);
hatfe=atan(imag(dnT)./real(dnT))./(2
*
pi
*
T);
close all
9
plot(fe,hatfe)
grid on
xlabel(f_e (True Value) [Hz])
ylabel(Estimated Value [Hz])
1 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 1
0.2
0.15
0.1
0.05
0
0.05
0.1
0.15
0.2
0.25
f
e
(True Value) [Hz]
E
s
t
i
m
a
t
e
d
V
a
l
u
e
[
H
z
]
Figure 6: S-curve.
Estimation over noisy channels
We now want to estimate the frequency error over noisy channels. In this example, we want to take an average
of the estimated frequency error to reduce the effect of noise.
Let us generate N pilot symbols such as
A=ones(1,N);
Then, the received sampled sample can be written as
ynT=A.
*
exp(j
*
2
*
pi
*
fe
*
[0:1:N-1]
*
T) + (randn(1,N) + ...
j
*
randn(1,N))/sqrt(snr);
Then, the output of the discriminator is
dnT=conj(ynT(1:N-1)).
*
ynT(2:N);
Note that in the above, taking arctangent for dnT and dividing it by 2T may be different from the true value,
f
e
, due to the noise. To reduce the noise effect, we make an average with the samples M, such as
10
L=floor(N/M);
for k=1:L,
meandnT(k)=mean(dnT((k-1)
*
M+1:M));
fehat(k)=atan(meandnT)/(2
*
pi
*
T);
end
Then, we run the simulation to see the performance of the estimation in terms of the root mean square error
(RMSE), dened as,
RMSE =
_
E[(
f
e
f
e
)
2
]
In summary, we can build the following function for the symbol rate 1/T = 15 KHz.:
function mse=lab72(snrdB,M,fe)
T=1/15000; %15 KHz
N=10000;
j=sqrt(-1);
snr=10.(snrdB/10);
A=ones(1,N);
ynT=A.
*
exp(j
*
2
*
pi
*
fe
*
[0:1:N-1]
*
T) + (randn(1,N) + j
*
randn(1,N))/sqrt(snr);
% M=100;
dnT=conj(ynT(1:N-1)).
*
ynT(2:N);
L=floor(length(dnT)/M);
for k=1:L,
meandnT(k)=mean(dnT((k-1)
*
M+1:k
*
M));
fehat(k)=atan(imag(meandnT(k))/real(meandnT(k)))/(2
*
pi
*
T);
end
mse=sqrt(mean((fehat-fe).2));
Then, for the SNR=10dB, f
e
= 100 Hz and the average length M=100, we have RMSE of 34.9815 Hz by
running m=lab72(10,100,10). You might have different value.
The MSE will be getting lower as the signal power P increases, equivalently the SNR increases. Let us run the
simulation to see the effect of the SNR for a xed value of f
e
= 100 Hz by running the following m-le. Its
result is depicted in Fig. 7.
snrdB=[0:2:20];
snr=10.(snrdB./10);
M=100;
fe=100;
for k=1:1:length(snr),
rmse(k)=lab72(snrdB(k),M,fe);
end
plot(snrdB,rmse);
grid on
xlabel(SNR [dB])
ylabel(RMSE [Hz])
11
0 2 4 6 8 10 12 14 16 18 20
0
50
100
150
200
250
300
350
SNR [dB]
R
M
S
E
[
H
z
]
Figure 7: Effect of SNR on the performance of frequency estimator.
The average length M will denitely affect the performance of SNR. Now let us see the effect of the aver-
age length for the xed SNR=10dB and f
e
= 100 Hz. Note that for this simulation, increase the number of
simulation N as 100000.
snrdB=10;
snr=10.(snrdB./10);
M=[10:10:500];
fe=100;
for k=1:1:length(M),
rmse(k)=lab72(snrdB,M(k),fe);
end
plot(M,rmse);
grid on
xlabel(SNR [dB])
ylabel(RMSE [Hz])
12
0 50 100 150 200 250 300 350 400 450 500
0
20
40
60
80
100
120
140
160
SNR [dB]
R
M
S
E
[
H
z
]
Figure 8: Effect of average length on the performance of frequency estimator.
13
Lab Homework
Problem 1. In class, we learned that the raised cosine pulse does not incur any intersymbol interference (ISI) because it
satises the Nyquist condition for no ISI and has lower effect of timing error comparing to the rectangular pulse
since the tail of the power spectral density decays as 1/t
3
wile for the rectangular case it decays as 1/t.
The raised cosine pulse, denoted by X
rc
(f), is the pulse after the matched lter is convolved with the transmitted
pulse over the channel.
Assuming the ideal band-limited channel, the transmit pulse and its matched lter at the receiver is given by
G(f) =
_
X
rc
(f) and the pulse in the time domain can be obtained by taking the inverse Fourier transform
yielding the root-raised cosine (RRC) pulse given by
g(t) =
sin
_
t
T
(1 )
+ 4
t
T
cos
_
t
T
(1 + )
t
T
_
1
_
4
t
T
_
2
_
Simulate the BPSK modulated digital transmission systems with RRC for the roll-off factor = 0.22 over
AWGN channels. Use the 8 over-sampling rate and see the effect of timing error of (1)0, (2) T/8, (3) 2T/8.
First, you may need to generate root raised cosine (RRC) FIR lter. The following function can help you
generate the RRC FIR lter.
function coef=rootrc(beta,t,T)
coef=ones(size(t));
i=find(t);
coef(i)=(sin(pi.
*
t(i).
*
(1-beta)./T)+4
*
beta
*
(t(i)./T)...
.
*
cos(pi
*
(t(i)./T).
*
(1+beta)))./(pi.
*
(t(i)./T)...
.
*
(1-(4.
*
beta.
*
t(i)./T).2));
In addition, you may need to replace
t=[-2:1/os:2];
tap=length(t);
% pulse
g=[zeros(1,length([-2:1/os:-0.5])),ones(1,length(-0.5+1/os:1/os:0.5)),...
zeros(1,length([0.5+1/os:1/os:2]))];
g=g/sqrt(sum(g.2));
in rectangular pulse case with
t=[-2:1/os:2];
g=rootrc(beta,t,1);
g=g/sqrt(sum(g.2));
tap=length(g);
Problem 2. Instead of averaging the output of the discriminator output, we might want to average the output of the arctan-
gent. To do this, after you obtain dnT, you calculate the frequency error estimation by
fehat = atan(imag(dnT)./dnT)/(2
*
pi
*
T);
14
Then, average fehat such as
L=floor(length(fehat)/M);
for k=1:length(L),
avgfehat(k)=mean(fehat((k-1)
*
M:k
*
M));
end
Let us call the above algorithm as phase averager (PA) while the previous one is called linear predictor (LP).
Now run the simulation for f
e
= 100Hz and 1/T = 15 KHz to answer the following questions.
1. For the PA, show the effect of SNR in terms of RMSE.
2. For the PA, show the effect of the average length M for SNR=10dB in terms of the RMSE.
3. Compare the PA and LP in terms of the RMSE for the SNR range of [-20:1:20] dB. Which one gives better
performance?
15