⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bpsk_awgn_pe.m

📁 收集的一组跟噪声产生以及消除、衡量消噪性能指标的MATLAB仿真源代码
💻 M
字号:
From: <由 Microsoft Internet Explorer 5 保存>
Subject: 
Date: Wed, 2 May 2007 13:14:37 +0800
MIME-Version: 1.0
Content-Type: text/html;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.mathworks.com/matlabcentral/files/9236/BPSK_AWGN_Pe.m
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2900.3059" name=3DGENERATOR></HEAD>
<BODY><PRE>%
%
% Avetis Ioannisyan
% 10/26/05
%
% Given desired SNR and the input signal, function outputs prob of error
% occuring in AWGN environment such that N(0, No/2). The input signal is
% modulated digital using ASK with amplitude -1 and +1
%
% Example:
% coefNum =3D 2^17;
% SNR =3D [0:0.1:10];
%=20
% signalTx =3D rand(1, coefNum);
% signalTx(find(signalTx &lt;=3D 0.5)) =3D -1;
% signalTx(find(signalTx &gt; 0.5)) =3D +1;
%=20
% [Pe] =3D BPSK_AWGN_Pe(signalTx, SNR);
%=20
% semilogy(SNR, Pe);


function [Pe] =3D BPSK_AWGN_Pe(signalTx, SNR)

% number of coef to generate (length)=20
coefNum =3D length(signalTx);

N0=3D[]; AWGN=3D[]; Pe=3D[]; signalRx=3D[];
% create white noise N(0, 0.5)
randn('state',sum(100*clock));      %reset randomizer
AWGN =3D randn(length(SNR), coefNum);

for i =3D 1:length(SNR)
	% make noise level from specified SNR:  No =3D 1/(10^(SNR/10)) assuming =
Eb=3D1
	N0(i) =3D 1/(10^(SNR(i)/10));  %generate No, or, sqrt(variance) =3D No =
for the WGN noise
	% adjust for the desired N(0,No/2) =3D&gt;  X =3D mue + sqrt(var)*N(0, =
0.5)
	AWGN(i,:) =3D sqrt(N0(i)./2) .* AWGN(i,:);
=09
	% produce received signal
	signalRx(i,:) =3D signalTx + AWGN(i,:);
=09
	% perform signal detection
	signalRx(i, find(signalRx(i,:) &lt;=3D 0)) =3D -1;
	signalRx(i, find(signalRx(i,:) &gt; 0)) =3D +1;
=09
	% estimate error probability
	error =3D length(find(signalRx(i,:)-signalTx));
	Pe(i) =3D error / coefNum;
end</PRE></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -