Code covered by the BSD License  

Highlights from
GMSK_MSK

image thumbnail

GMSK_MSK

by

 

Comparison between GMSK-Modulation (GSM standard), MSK Type A-Modulation and MSK Type B-Modulation

GMSK_config.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Simulation Modell GMSK compared to MSK Type B and Type A
% 2009 by P. Fetzer, Konrad Benedict
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear all;
clc;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------ Config GMSK
SNR = 40; % SNR / dB
lengthOfSymbol = 8;
simulationTime = 200;
sampleTime = 1;
simin.time = [0:sampleTime:simulationTime];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------ create Inputdata (choose one of the Data sets)

 simin.signals.values =  randi([-0 1],length(simin.time),1); % random Bitstream
% simin.signals.values = ones(length(simin.time), 1); % Bitstream consisiting of ones
% simin.signals.values = zeros(length(simin.time), 1); % Bitstream consisiting of zeros
% simin.signals.values = ((square(2*pi*simin.time/1.9999999, 50)+1)/2)'; % Bitstream constantly switching between zero and one

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------ Simulation Simulink model

 sim('GMSK_MSK.mdl');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------ FFT-Analysis

L = length(simoutGmsk.signals.values);
Ts = simoutTime.signals.values(2)-simoutTime.signals.values(1);
Fs = 1/Ts;
window = blackman(L);

NFFT = 2^nextpow2(L);
f = Fs/2*linspace(-1,1,NFFT);

% GMSK-Signal
Y_Gmsk = fft(simoutGmsk.signals.values.*window,NFFT)/L;
Y_Gmsk = Y_Gmsk/max(abs(Y_Gmsk)); % Norm
Y_Gmsk_dB = 10*log10(abs([Y_Gmsk(end/2:end);Y_Gmsk(1:end/2-1)]).^2);

% MSK-Typ B-Signal
Y_MskB = fft(simoutMskB.signals.values.*window,NFFT)/L;
Y_MskB = Y_MskB/max(abs(Y_MskB)); % Norm
Y_MskB_dB = 10*log10(abs([Y_MskB(end/2:end);Y_MskB(1:end/2-1)]).^2);

% MSK-Typ A-Signal
Y_MskA = fft(simoutMskA.signals.values.*window,NFFT)/L;
Y_MskA = Y_MskA/max(abs(Y_MskA)); % Norm
Y_MskA_dB = 10*log10(abs([Y_MskA(end/2:end);Y_MskA(1:end/2-1)]).^2);


% plot two-side spectrum
f1 = figure(1);
set(f1, 'Name', 'Power Density Spectrum ');
plot(f,Y_MskA_dB, 'g') ;
hold on;
plot(f,Y_MskB_dB, 'r') ;
plot(f,Y_Gmsk_dB, 'b') 
hold off;
legend('MSK Type A', 'MSK Type B', 'GMSK');
title('Power Density Spectrum');
xlabel('Frequency / Hz');
ylabel('|Y(f)|^2 normed / dB');
ylim([-70;1]);
xlim([-(3/sampleTime),(3/sampleTime)]);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------ Plot Delay over time
f2 = figure(2);
set(f2, 'Name', 'Delay over time');

% MSK Typ A
subplot(3,1,1);
plot(simoutTime.signals.values,angle(simoutMskA.signals.values).*(180/pi));
set(gca, 'YTick',  [-200 -100 0 100 200],'YTickLabel', [-180 -90 0 90 180]);
title('MSK Type A');
xlabel('time / s');
ylabel('Delay / Degree');

% MSK Typ B
subplot(3,1,2);
plot(simoutTime.signals.values,angle(simoutMskB.signals.values).*(180/pi));
set(gca, 'YTick',  [-200 -100 0 100 200],'YTickLabel', [-180 -90 0 90 180]);
title(' MSK Type B');
xlabel('Zeit / s');
ylabel('Phase / Grad');

% GMSK
subplot(3,1,3);
plot(simoutTime.signals.values,angle(simoutGmsk.signals.values).*(180/pi));
set(gca, 'YTick',  [-200 -100 0 100 200],'YTickLabel', [-180 -90 0 90 180]);
title('GMSK');
xlabel('Zeit / s');
ylabel('Phase / Grad');





Contact us