initial commit
This commit is contained in:
420
Versuch 1 - Fehlerwahrscheinlichkeit/Versuch1.ipynb
Normal file
420
Versuch 1 - Fehlerwahrscheinlichkeit/Versuch1.ipynb
Normal file
File diff suppressed because one or more lines are too long
134
Versuch 1 - Fehlerwahrscheinlichkeit/Versuch1.m
Executable file
134
Versuch 1 - Fehlerwahrscheinlichkeit/Versuch1.m
Executable file
@@ -0,0 +1,134 @@
|
||||
%==========================================================================
|
||||
% 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)')
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
function p=fehlerwahrscheinlichkeit(Ue, func0, func1)
|
||||
err0 = integral(func0, Ue, Inf);
|
||||
err1 = integral(func1, -Inf, Ue);
|
||||
p=err0+err1;
|
||||
end
|
||||
11
Versuch 1 - Fehlerwahrscheinlichkeit/gauss_pdf.m
Executable file
11
Versuch 1 - Fehlerwahrscheinlichkeit/gauss_pdf.m
Executable file
@@ -0,0 +1,11 @@
|
||||
function p = gauss_pdf(x,sigma,m)
|
||||
% gauss_pdf berechnet die Verteilungsdichtefunktion
|
||||
% out = gauss_pdf(x,sigma,m)
|
||||
% INPUT:
|
||||
% x - Dargestellter Bereich
|
||||
% sigma - Mittelwert des Rauschens
|
||||
% m - Standardabweichung bzw. Leistung
|
||||
% OUTPUT:
|
||||
% p - Gau<EFBFBD>-Verteilungsdichtefunktion
|
||||
p = 1/sqrt(2*pi*sigma.^2)*exp(-(x-m).^2/(2*sigma.^2));
|
||||
end
|
||||
11
Versuch 1 - Fehlerwahrscheinlichkeit/symbol_fwk.m
Executable file
11
Versuch 1 - Fehlerwahrscheinlichkeit/symbol_fwk.m
Executable file
@@ -0,0 +1,11 @@
|
||||
function wk = symbol_fwk(SNR,stufe)
|
||||
% symbol_fwk berechnen die Symbolfehlerwahrscheinlichkeit f<EFBFBD>r m-stufigen
|
||||
% Systemen
|
||||
% out = gauss_pdf(x,sigma,m)
|
||||
% INPUT:
|
||||
% SNR - Signal-zu-Rausch-Verh<EFBFBD>ltnis
|
||||
% stufe - Amplitudenstufen
|
||||
% OUTPUT:
|
||||
% wk - Symbolfehlerwahrscheinlichkeit
|
||||
wk =(stufe-1)/stufe*(1-erf((3/(stufe.^2-1)*SNR/2).^0.5));
|
||||
end
|
||||
Reference in New Issue
Block a user