Report To GMSK Simulation PDF
Report To GMSK Simulation PDF
MATLAB CODE:
clear all;
close all;
%*********************************
% Variable Definition
%*********************************
DRate = 1; % data rate or 1 bit in one second
M = 18; % no. of sample per bit
N = 36; % no. of bits for simulation [-18:18]
BT = 0.5; % Bandwidth*Period (cannot change )
T = 1/DRate; % data period , i.e 1 bit in one second
Ts = T/M;
k=[-18:18]; % Chen's values. More than needed;
% only introduces a little more delay
%******************************************************************
**********************
% CONSTRUCTION OF GAUSSIAN FILTER FOLLOWED BY SHAPING OF
DATA BITS USING GAUSSIAN FILTER %
%******************************************************************
**********************
alpha = sqrt(log(2))/(2*pi*BT); % alpha calculated for the gaussian filter
response
h = exp(-(k*Ts).^2/(2*alpha^2*T^2))/(sqrt(2*pi)*alpha*T); % Gaussian
Filter Response in time domain
figure;
plot(h,'*r')
title('Response of Gaussian Filter');
xlabel( 'Sample at Ts');
ylabel( 'Normalized Magnitude');
grid;
m = filter(h,1,bits);% bits are passed through the all pole filter described by
h, i.e bits are
% shaped by gaussian filter
t0=.35; % signal duration
ts=0.00135; % sampling interval
fc=200; % carrier frequency
kf=100; % Modulation index
fs=1/ts; % sampling frequency
t=[0:ts:t0]; % time vector
df=0.25; % required frequency resolution
int_m(1)=0;
for i=1:length(t)-1 % Integral of m
int_m(i+1)=int_m(i)+m(i)*ts;
end
tx_signal=cos(2*pi*fc*t+2*pi*kf*int_m);
% Frequency Modulation (FM) is a form of angle modulation in which the
instantaneous frequency
% of the carrier signal is varied linearly with the baseband message signal
m(t),
x = cos(2*pi*fc*t);
y = sin(2*pi*fc*t);
figure;
subplot(2,1,1)
stem(bits(1:250))
title('RANDOM DATA BITS,+1 FOR ONE AND -1 FOR ZERO ');
grid;
subplot(2,1,2)
plot(m(1:250),'r')
title('GAUSSIAN SHAPED TRAIN');
xlim([0 260]);
figure;
plot(tx_signal)
title('MODULATED SIGNAL');
xlim([0 225]);
% Channel Equalization
% First, a channel simulator is designed to introduce effects common to
wireless signals such as
% Doppler shifts, Rayleigh fading, phase offsets, and multipath
interference. These channel
% conditions are used to test the performance of the system in a simulated
mobile radio environment.
% Second, AWGN is added in the signal. The variance of the Gaussian noise
may be changed to test
% the performance for different signal to noise ratios, while signal
amplitude is held constant.
% load 'C:\CASE\Digital_Communication\project\channel.mat'
load 'channel.mat'
h = channel;
N1 = 700;
x1 = randn(N1,1);
d = filter(h,1,x1);
Ord = 256;
Lambda = 0.98;
delta = 0.001;
P = delta*eye(Ord);% Create output pulse: rectangular pulse convolved with
first-order
% low-pass filter impulse response.
w = zeros(Ord,1);
for n = Ord:N1
u = x1(n:-1:n-Ord+1);
pi = P*u;
k = Lambda + u'*pi;
K = pi/k;
e(n) = d(n) - w'*u;
w = w + K *e(n);
PPrime = K*pi';
P = (P-PPrime)/Lambda;
w_err(n) = norm(h-w);
end
figure;
subplot(2,1,1);
plot(h,'g');
title('CHANNEL RESPONSE');
subplot(2,1,2);
plot(w,'r');
title('ADAPTIVE CHANNEL RESPONSE');
% now the channel effects are added to our transmitted signal
rcvd_signal = conv(h,tx_signal);
figure;
plot(rcvd_signal);
title('RECEIVED SIGNAL, AFTER INDUCING CHANNEL EFFECTS');
axis([50 400 -0.8 0.8])
eq_signal = conv(1/w,rcvd_signal);
figure;
%subplot(3,1,1);
plot(eq_signal,'r');
axis([150 550 -2.5 2.5])
title('RECEIVED SIGNAL AFTER CANCELLING EFFECTS OF CHANNEL
(EQUALIZATION DONE)');
figure;
subplot(2,1,1);
plot(eq_signal,'g');
title('RECEIVED SIGNAL AFTER CANCELLING EFFECTS OF CHANNEL
(AXIS CORRECTED)');
axis([208 500 -2 2]);% here the scale for the received signal is corrected
subplot(2,1,2);
plot(tx_signal,'r');
title('MODULATED SIGNAL');
%The following is the source code for a Matlab function that does one-bit
diffren-
%tial detection. This detection function also simulates synchronization using
Gardner's
%timing recovery algorithm for the case of over-sampling.It was creating
%the problem thats why it has been left
% num = 1;
% time = 2*N+1;
% T =N;
% mu = 0.02;
% error(1) = 0;
% shift = 0;
% timing_error =0;
% totsteps = 0;.44
%B = fir1(32,0.18);
% Demodulation
eq_signal2 = eq_signal(215:460-1);
eq_signal1 = eq_signal(200:460-1);
EQ_SIG=awgn(eq_signal2,20);
% here directly matlab function is made use of for the demodulation of the
% received signal
z_dir=demod(EQ_SIG,fc,fs,'fm',1);
%figure;plot(z_dir);title('SIGNAL OBTAINED FREQUENCY
DEMODULATION)');
In = x.*eq_signal1;
Qn = y.*eq_signal1;
noiseI = awgn(In,20);
noiseQ = awgn(Qn,20);
I = In + noiseI;
Q = Qn + noiseQ;
LP = fir1(32,0.18);
yI = filter(LP,1,I);
yQ = filter(LP,1,Q);
figure;
subplot(2,1,1);
plot(yI);
title('INPHASE COMPONENT');
xlim([0 256]);
subplot(2,1,2);
plot(yQ,'r');
title('QUADRATURE COMPONENT');
xlim([0 256]);
Z = yI + yQ*j;
demod(1:N) = imag(Z(1:N));
demod(N+1:length(Z)) = imag(Z(N+1:length(Z)).*conj(Z(1:length(Z)-N)));
xt = -10*demod(1:N/2:length(demod));
xd = xt(4:2:length(xt));
figure;
stem(xd)
title('DEMODULATED SIGNAL USING OQPSK');
%m2 = conv(1/h,z_dir);figure;plot(m2)% here signal is convolved back with
the inverse gaussian filter
% to recover the bits
figure;
subplot(2,1,1);stem(z_dir,'r');title('RECOVERED SIGNAL AFTER
FREQUENCY DEMODULATION');
subplot(2,1,2);stem(bits(1:250));title('BITS WHICH WERE
TRANSMITTED');
%figure;
%plot(demod);
% while(time <=length(Z)-T)
% num = num+1;
% samples(num) = (demod(time) >0)*2-1
% error(num) = (sign(demod(fix(time)))-sign(demod(fix(time-
T))))*(demod(time-T/2));
% shift = error(num)*N*mu;
% steps = fix(shift);
% time = time + T-steps;
% end
Results:
figure 1
figure 2
figure 3
figure 4
figure 5
figure 6
fig 7
fig 8
fig 9
fig 10
IMPLEMENTATION OF GMSK RADIO MODULATION
GMSK are its relatively narrow BW, constant envelope modulation, and its
occur at the carrier zero crossings. The fundamental problem with MSK is
its side lobes extending well above the data rate as shown in the figure.
filtered prior to modulation using a specific form of low pass filtering. The
pre-modulation low pass filter must have a narrow BW with a sharp cutoff
introduces ISI in the transmitted signal, but it can be shown that the
π ⎛ −π 2 ⎞
hG (t ) = exp⎜⎜ 2 t 2 ⎟⎟
α ⎝ α ⎠
ln 2 0.5887
α= =
2B B
transmitted signal, but it can be shown that the degradation is not severe if
0.5.
Gaussian Filtering:
The GMSK modulation is done with the help of Gaussian shaped filter.
The signal is made by convolving the bit sequence with the Gaussian Filter.
The message signal is integrated to get the phase of it. Then this phase is
GMSK signal.
Shaped
t
s FM = Ac cos[2πfct + θ (t )] = Ac cos[2πf c t + 2πk f ∫ m(η )dη ]
−∞
The Channel:
First, a channel simulator is designed to introduce effects common to
wireless signals such as Doppler shifts, Rayleigh fading, phase offsets, and
AWGN is added in the signal. The variance of the Gaussian noise may be
changed to test the performance for different signal to noise ratios, while
every Tb sec) does not pass through a zero and so no phase change occurs.
Channel Equalization
Channel Equalization is to cancel the effect of the channel distortion.
the bits.
Basic Idea
All the equalization filters are basically adaptive transversal filter, they are
J = E(e2)
This is basically cost function for over scenario and we have to minimize it
with respect to our weights of transversal filter which are basically adapting
J = E[(y – d)2]
J = E[ue]
W = R-1r
All the algorithms are basically are the version of this equation.