📄 truwbexec.m
字号:
% TR-UWB Simulation Executor
% Author: Caglar Arslan
% Date: 03-10-2007
%--------------------------------------------------------------------------
% Note: In order to have a low BER, the Nf and Tf/Td ratio play an
% important role.
clc
clear all
close all
%Experiment #1
numberOfBits=10;
numberOfBlocks=5;
% For faster simulation, the simulation of "numberOfBits"
% is run "numberOfBlocks" times which results in having a total of
% (numberOfBits X numberOfBlocks) bits
fs=25e9;
Ep=1;
tc=1e-9;
Tf=20;
Nf=4;
Td=2;
Nc=Tf;
AWGNSNR=-10;
%Generate the transmission signal
totalProcessedBits=0;
totalWrongBits=0;
tic
for i=1:numberOfBlocks
[allPulses SimulationTime DataSequence THCode] = TRUWBTXfinal(numberOfBits,fs,Ep,tc,Tf,Nf,Td,Nc,2,0);
%Add the noise
[allPulsesWithNoise] = NoiseGenerator(allPulses,AWGNSNR);
%Send the signal to the receiver
[receivedData] = TRUWBRX(allPulsesWithNoise,numberOfBits,Tf,Nf,Td,fs,0);
%Calculate the BER
[BER wrongBits TotalBits] = BERCalculator(DataSequence,receivedData);
totalWrongBits=totalWrongBits+wrongBits;
totalProcessedBits=totalProcessedBits+TotalBits;
end
toc
%Report
disp('BER - Simulation');
BER=totalWrongBits/totalProcessedBits
totalProcessedBits
disp('BER - Calculation');
[result] = QBEP(AWGNSNR,Ep,Tf*Nf*1e-9,1e9)
disp('Total Signal Length (time)');
time=SimulationTime(length(SimulationTime))*numberOfBlocks
disp('Data Rate');
dataRate=(numberOfBits*numberOfBlocks)/time
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -