You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
135 lines
4.0 KiB
Matlab
135 lines
4.0 KiB
Matlab
%==========================================================================
|
|
% Rechnerübung zur Signalübertragung II
|
|
% Versuch 1: Fehlerwahrscheinlichkeit
|
|
%==========================================================================
|
|
|
|
%--------------------------------------------------------------------------
|
|
% Teil 1.1 Verteilungsdichtefunktion von weißem, gauß-verteiltem Rauschen
|
|
%--------------------------------------------------------------------------
|
|
|
|
clear all;
|
|
close all;
|
|
clc;
|
|
|
|
% Dargestellter Bereich
|
|
x = -9:0.1:9;
|
|
% Mittelwert des Rauschens
|
|
m = 0;
|
|
% Standardabweichung bzw. Leistung
|
|
sigma = 1;
|
|
% Gauß-Verteilungsdichtefunktion
|
|
py1 = gauss_pdf(x,sigma,m);
|
|
sigma = 2;
|
|
py2 = gauss_pdf(x,sigma,m);
|
|
|
|
% py1 und py2 plotten
|
|
figure(1)
|
|
axis([-3 3 0 0.5])
|
|
plot(x,py1,'LineWidth',2.5,'Color',[1 0 0])
|
|
axis([-3 3 0 0.5])
|
|
grid on
|
|
hold on
|
|
plot(x,py2,'LineWidth',2.5,'Color',[0 0 1])
|
|
title('Abbildung 1: Verlauf der Verteilungsdichtefunktion eines Gauß-Prozesses für sigma1=1.0 und sigma2=2.0')
|
|
xlabel('x')
|
|
ylabel('py1(x,1.0,0.0) (rot), py2(x,2.0,0.0) (blau)')
|
|
hold off
|
|
|
|
%--------------------------------------------------------------------------
|
|
% Teil 1.2 Sendestatistik bei bipolarer Übertragung
|
|
%--------------------------------------------------------------------------
|
|
|
|
% U0 = 0 wird mit der Wahrscheinlichkeit p0 und U1 = +2 mit der
|
|
% Wahrscheinlichkeit p1 gesendet.
|
|
% Bei optimal codierter Quelle gilt p0 = 0.5
|
|
|
|
% Hinweis zur Frage a): Hier können Sie p0 ändern -->
|
|
p0 = 0.5;
|
|
p1 = 1 - p0;
|
|
|
|
% Verteilungsdichtefunktion am Kanalausgang für sigma = 1:
|
|
p0_py0 = p0*py1;
|
|
figure(2)
|
|
axis([-2 4 0 0.4])
|
|
plot(x,p0_py0,'LineWidth',2.5,'Color',[1 0 0])
|
|
axis([-2 4 0 0.4])
|
|
grid on
|
|
hold on
|
|
|
|
p1_py1 = p1*gauss_pdf(x,1,2);
|
|
plot(x,p1_py1,'LineWidth',2.5,'Color',[0 0 1])
|
|
title('Abbildung 2: Verlauf der Verteilungsdichtefunktionen mit sigma=1')
|
|
xlabel('x')
|
|
ylabel('p0.py0(x,1.0,0.0) (rot), p1.py1(x,1.0,2.0) (blau)')
|
|
hold off
|
|
|
|
|
|
% Verteilungsdichtefunktion am Kanalausgang für sigma = 2:
|
|
p0_py0 = p0*gauss_pdf(x,2,0);
|
|
figure(3)
|
|
axis([-4 6 0 0.2])
|
|
plot(x,p0_py0,'LineWidth',2.5,'Color',[1 0 0])
|
|
axis([-4 6 0 0.2])
|
|
grid on
|
|
hold on
|
|
|
|
p1_py1 = p1*gauss_pdf(x,2,2);
|
|
plot(x,p1_py1,'LineWidth',2.5,'Color',[0 0 1])
|
|
title('Abbildung 3: Verlauf der Verteilungsdichtefunktionen mit sigma=2')
|
|
xlabel('x')
|
|
ylabel('p0.py0(x,2.0,0.0) (rot), p1.py1(x,2.0,2.0) (blau)')
|
|
hold off
|
|
|
|
% Verteilungsdichtefunktion mit höherem Sendepegel
|
|
% U0 = 0, U1 = +4
|
|
p0_py0 = p0*gauss_pdf(x,2,0);
|
|
figure(4)
|
|
axis([-4 8 0 0.2])
|
|
plot(x,p0_py0,'LineWidth',2.5,'Color',[1 0 0])
|
|
axis([-4 8 0 0.2])
|
|
grid on
|
|
hold on
|
|
|
|
p1_py1 = p1*gauss_pdf(x,2,4);
|
|
plot(x,p1_py1,'LineWidth',2.5,'Color',[0 0 1])
|
|
title('Abbildung 4: Verlauf der Verteilungsdichtefunktionen bei höherer Rauschleistung und höherem Sendepegel')
|
|
xlabel('x')
|
|
ylabel('p0.py0(x,2.0,0.0) (rot), p1.py1(x,2.0,4.0) (blau)')
|
|
hold off
|
|
|
|
%--------------------------------------------------------------------------
|
|
% Teil 1.3 Symbolfehlerwahrscheinlichkeit bei mehrstufiger Übertragung
|
|
%--------------------------------------------------------------------------
|
|
|
|
% Die Symbolfehlerwahrscheinlichkeiten für bestimmte SNR
|
|
|
|
SNR = 0:0.01:100;
|
|
figure(5)
|
|
|
|
% stufe = 2
|
|
wk2 = symbol_fwk(SNR,2);
|
|
semilogy(10*log10(SNR),wk2,'LineWidth',2.5,'Color',[1 0 0]);
|
|
axis([0 20 1e-10 1])
|
|
hold on
|
|
grid on
|
|
|
|
% stufe = 4
|
|
wk4 = symbol_fwk(SNR,4);
|
|
semilogy(10*log10(SNR),wk4,'LineWidth',2.5,'Color',[0 0 1]);
|
|
|
|
% stufe = 6
|
|
wk6 = symbol_fwk(SNR,6);
|
|
semilogy(10*log10(SNR),wk6,'LineWidth',2.5,'Color',[0 1 0]);
|
|
|
|
% stufe = 8
|
|
wk8 = symbol_fwk(SNR,8);
|
|
semilogy(10*log10(SNR),wk8,'LineWidth',2.5,'Color',[1 0 1]);
|
|
|
|
% stufe = 16
|
|
wk16 = symbol_fwk(SNR,16);
|
|
semilogy(10*log10(SNR),wk16,'LineWidth',2.5,'Color',[0 1 1]);
|
|
title('Abbildung 5: Die Symbolfehlerwahrscheinlichkeit in Abhängigkeit vom SNR')
|
|
xlabel('10*log10(SNR)')
|
|
ylabel('P(SNR,2) (rot), P(SNR,4) (blau), P(SNR,6) (grün), P(SNR,8) (magenta), P(SNR,16) (cyan)')
|
|
|