fsruwbexec.m

来自「UWB无线通信系统仿真」· M 代码 · 共 50 行

M
50
字号
% 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;
fs=8e9;
Ep=1;
tc=1e-9;
Tf=10;
Nf=5;
Nc=Tf;
AWGNSNR=-10;

%Generate the transmission signal
totalProcessedBits=0;
totalWrongBits=0;
tic
for i=1:numberOfBlocks
    [allPulses SimulationTime DataSequence THCode] = FSRUWBTX(numberOfBits,fs,Ep,tc,Tf,Nf,Nc,2,0);
    %Add the noise
    [allPulsesWithNoise] = NoiseGenerator(allPulses,AWGNSNR);
    %Send the signal to the receiver
    [receivedData mixerTerm iW] = FSRUWBRX(allPulsesWithNoise,SimulationTime,numberOfBits,Tf,Nf,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 Simulation Time');
time=SimulationTime(length(SimulationTime))*numberOfBlocks
disp('Data Rate');
dataRate=(numberOfBits*numberOfBlocks)/time

⌨️ 快捷键说明

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