BPSK Signal through frequency selective channel

5
13 Experiment 5: Aim: To pass a BPSK signal through a frequency selective fading channel. Perform channel equalization using LMS adaptive filter. And observe BER vs. SNR plot for various SNRs. Theory: Multipath Fading: If the channel possesses a constant gain and linear phase response over a bandwidth that is smaller than the bandwidth of the transmitted signal, then the channel creates frequency selective fading on the received signal. Under such condition the channel impulse response has a multipath delay spread which is greater than the reciprocal bandwidth of the transmitted message waveform. When this occurs, the received signal includes multiple versions of the transmitted waveform which are attenuated (faded) and delayed in time, and hence the received signal is distorted in time. Frequency selective fading is due to the time dispersion of the transmitted symbol within the channel. Thus the channel includes inter- symbol interference (ISI). Adaptive Channel Equalization: Intersymbol interference (ISI) caused by multipath bandlimited (frequency selective) time dispersive channel distorts the transmitted signal causing bit error at the receiver. ISI has been recognized as a major drawback to high speed data transmission. Equalization is a technique used to combat the ISI. An equalizer is usually implemented at baseband or at IF in a receiver. Since the baseband complex envelope expression can be used to represent bandpass waveforms, the channel response, demodulated signal and adaptive equalizer algorithms are usually simulated and implemented at baseband. If x(t) be the original information signal, if f(t) be the combined complex baseband impulse response of the transmitter, channel and the RF/IF sections of the receiver, the signal received by the equalizer can be expressed as: ݕ(ݐ)= ݔ(ݐ) (ݐ)+ (ݐ) Where, f*(t) is the complex conjugate of f(t) and n b (t) is the baseband noise at the input of the equalizer. In modern communication systems, as equalizer is implemented in digital computers, the input to the equalizer in discrete time can be expressed as ݕ()= ݔ() ()+ () Adaptive equalizers are used to estimate ݔ() of x(n) from y(n) at the receiver. An equalizer is basically an FIR filter that changes it’s parameters to match the desired output. One most commonly used equalizer is the Least Mean Square (LMS) equalizer. The update algorithm of LMS equalizer is given by: ݓାଵ = ݓ + ߤ()ݔ̅

description

MATLAB Program to simulate a BPSK signal through a frequency selective channel

Transcript of BPSK Signal through frequency selective channel

Page 1: BPSK Signal through frequency selective channel

13

Experiment 5:

Aim: To pass a BPSK signal through a frequency selective fading channel. Perform channel equalization using LMS adaptive filter. And observe BER vs. SNR plot for various SNRs.

Theory:

Multipath Fading: If the channel possesses a constant gain and linear phase response over a bandwidth that is smaller than the bandwidth of the transmitted signal, then the channel creates frequency selective fading on the received signal. Under such condition the channel impulse response has a multipath delay spread which is greater than the reciprocal bandwidth of the transmitted message waveform. When this occurs, the received signal includes multiple versions of the transmitted waveform which are attenuated (faded) and delayed in time, and hence the received signal is distorted in time. Frequency selective fading is due to the time dispersion of the transmitted symbol within the channel. Thus the channel includes inter-symbol interference (ISI).

Adaptive Channel Equalization: Intersymbol interference (ISI) caused by multipath bandlimited (frequency selective) time dispersive channel distorts the transmitted signal causing bit error at the receiver. ISI has been recognized as a major drawback to high speed data transmission. Equalization is a technique used to combat the ISI.

An equalizer is usually implemented at baseband or at IF in a receiver. Since the baseband complex envelope expression can be used to represent bandpass waveforms, the channel response, demodulated signal and adaptive equalizer algorithms are usually simulated and implemented at baseband.

If x(t) be the original information signal, if f(t) be the combined complex baseband impulse response of the transmitter, channel and the RF/IF sections of the receiver, the signal received by the equalizer can be expressed as:

푦(푡) = 푥(푡) ∗ 푓∗(푡) + 푛 (푡)

Where, f*(t) is the complex conjugate of f(t) and nb(t) is the baseband noise at the input of the equalizer. In modern communication systems, as equalizer is implemented in digital computers, the input to the equalizer in discrete time can be expressed as

푦(푛) = 푥(푛) ∗ 푓∗(푛) + 푛 (푛)

Adaptive equalizers are used to estimate 푥(푛) of x(n) from y(n) at the receiver. An equalizer is basically an FIR filter that changes it’s parameters to match the desired output. One most commonly used equalizer is the Least Mean Square (LMS) equalizer. The update algorithm of LMS equalizer is given by:

푤 = 푤 + 휇푒(푛)푥̅∗

Page 2: BPSK Signal through frequency selective channel

14

Where, 푤 is the present filter parameter vector, 푤 is the next filter parameter vector, 푥̅∗ is the complex conjugate of the input vector {x(n), x(n – 1), x(n – 2), … , x(n – L + 1)}, 휇 is the step size of the adaptive equalizer and 푒(푛) = 푥(푛) − 푥(푛) is the error.

Figure: A basic linear equalizer during training

It is to be noted that the value of actual signal x(n) must be known to the signal to calculate the error e(n) in order to update the adaptive equalizer. However, practically the receiver cannot have the values of x(n). Therefore, some pilot symbols are transmitted along with the actual payload to train the adaptive equalizer. These pilots are inserted either at the beginning, or at the end or at the middle of a message block. These pilots are known to the receiver. These are used to train the adaptive filter. Once the filter is trained, the resultant FIR filter acts as an inverse of the complex filter f(n). Thus we can have:

푥(푛) = 푦(푛) ∗ 푤(푛)

Program

%multipath channel equalization (block type channel) clear all; close all; clc %defining modulator and demodulator M=2; hm=modem.pskmod(M); hd=modem.pskdemod(M); %Length initialization

Page 3: BPSK Signal through frequency selective channel

15

N=10000; Nf=1000; Np=200; rng('shuffle'); %Creating piolt pilot_bits=randi([0,1],1,Np); pilot_symb=modulate(hm,pilot_bits); ch_ord=4; nf_msg=Nf-Np; N1=ceil(N/nf_msg); rchn1=1/sqrt(2)*(randn(ch_ord,N1)+1j*randn(ch_ord,N1)); rchn1=rchn1/max(max(rchn1)); for k=1:N1 rchn1(:,k)=sort(rchn1(:,k),'descend'); end % rchn1=rchn1/norm(rchn1); rchn=ones(Nf,ch_ord); for k=1:Nf:N for k1=1:ch_ord rchn(k:k+Nf-1,k1)=rchn1(k1,(k-1)/Nf+1)*ones(Nf,1); end end figure, subplot 211 plot(abs(rchn)) title('Channel Magnitude') subplot 212 plot(angle(rchn)/pi) title('Channel Phase/pi') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Input signal x=randi([0,1],1,N); if(mod(N,nf_msg)~=0) N_add=ceil(N/nf_msg)*nf_msg-N; N=N+N_add; x=[x,zeros(1,N_add)]; end snr=-10:10; N_full=Nf*N/nf_msg; Tx_chan=zeros(1,N_full); count=1; for k=1:nf_msg:N x_temp=x(k:k+nf_msg-1); mod_msg=modulate(hm,x_temp); Tx_symb=[mod_msg(1:nf_msg/2),pilot_symb,mod_msg(nf_msg/2+1:nf_msg)]; w=rchn1(1:ch_ord,((count-1)/Nf+1)); chan_out=filter(w,1,Tx_symb); Tx_chan(count:count+Nf-1)=chan_out; count=count+Nf; end ber_ex=zeros(size(snr)); ber_th=zeros(size(snr)); eq_ord=5; mu=0.001; for k=1:length(snr) Tx_sig=awgn(Tx_chan,snr(k)); Rx=zeros(1,N); count=1; for k1=1:Nf:N_full Tx_temp=Tx_sig([(k1:k1+nf_msg/2-1),(k1+nf_msg/2+Np:k1+Nf-1)]); pilot_rx=Tx_sig(k1+nf_msg/2:k1+nf_msg/2+Np-1);

Page 4: BPSK Signal through frequency selective channel

16

%Adaptive equalization (MSE algorithm) h=zeros(1,eq_ord); er1=zeros(Np-eq_ord+1,1); for k2=eq_ord:Np pk=pilot_rx(k2:-1:k2-eq_ord+1); s=pk*conj(h'); er1(k2)=pilot_symb(k2)-s; h=h+mu*conj(pk)*(er1(k2)); end Rx_temp=filter(h,1,Tx_temp); Rx(count:count+nf_msg-1)=demodulate(hd,Rx_temp); count=count+nf_msg; end ber_temp=length(find(x-Rx)~=0); ber_ex(k)=ber_temp/length(Rx); ber_th(k)=berfading(snr(k),'psk',M,1); % figure, semilogy(abs(er1)); end figure l1=semilogy(snr,ber_ex,'b-s'); hold on l2=semilogy(snr,ber_th,'r'); legend('BER Experimental','BER Theoretical') xlabel('SNR (dB)'); ylabel('BER'); Channel Response:

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000

0.5

1Channel Magnitude

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000-1

-0.5

0

0.5

1Channel Phase/pi

Page 5: BPSK Signal through frequency selective channel

17

Output:

-10 -8 -6 -4 -2 0 2 4 6 8 1010-2

10-1

100

SNR (dB)

BE

R

BER ExperimentalBER Theoretical