Made some progress, per snr sweep is plotted now, the satellites orbital shift is used in calculated now, code is prepared for more than one mcs value
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
function numPacketErrors = simulateTransmission(cfgEHT, channel, snr, packets, maxNumErrors, simParameters, chanBW, substreamIndex)
|
||||
function [numPacketErrors, numPacketsSimulated ]= simulateTransmission(cfgEHT, channel, maxChDelay, snr, maxNumPackets, maxNumErrors, simParameters, chanBW, substreamIndex, elevationAngles)
|
||||
numPacketErrors = 0;
|
||||
numPacketsSimulated = 0;
|
||||
|
||||
ofdmInfo = wlanEHTOFDMInfo('EHT-Data', cfgEHT);
|
||||
ind = wlanFieldIndices(cfgEHT);
|
||||
@@ -14,15 +15,16 @@ function numPacketErrors = simulateTransmission(cfgEHT, channel, snr, packets, m
|
||||
|
||||
snrVal = convertSNR(snr, "snrsc", "snr", FFTLength=ofdmInfo.FFTLength, NumActiveSubcarriers=ofdmInfo.NumTones);
|
||||
|
||||
for packetIdx = 1:packets
|
||||
if numPacketErrors >= maxNumErrors
|
||||
break;
|
||||
end
|
||||
while numPacketErrors < maxNumErrors && numPacketsSimulated < maxNumPackets
|
||||
numPacketsSimulated = numPacketsSimulated + 1;
|
||||
|
||||
packetElevationAngle = elevationAngles(numPacketsSimulated);
|
||||
channel.SatelliteDopplerShift = dopplerShiftCircularOrbit(packetElevationAngle, simParameters.SatelliteAltitude, simParameters.MobileAltitude, simParameters.CarrierFrequency);
|
||||
|
||||
txPSDU = randi([0 1], psduLength(cfgEHT) * 8, 1);
|
||||
tx = wlanWaveformGenerator(txPSDU, cfgEHT);
|
||||
|
||||
txPad = [tx; zeros(50, cfgEHT.NumTransmitAntennas)];
|
||||
txPad = [tx; zeros(maxChDelay, cfgEHT.NumTransmitAntennas)];
|
||||
|
||||
reset(channel);
|
||||
rx = awgn(channel(txPad), snrVal);
|
||||
@@ -37,12 +39,12 @@ function numPacketErrors = simulateTransmission(cfgEHT, channel, snr, packets, m
|
||||
coarseFrequencyOffset = wlanCoarseCFOEstimate(lstf, chanBW);
|
||||
rx = frequencyOffset(rx, simParameters.SampleRate, -coarseFrequencyOffset);
|
||||
|
||||
nonhtfields = rx(coarsePacketOffset + (ind.LSTF(1) : ind.LSTF(2)), :);
|
||||
nonhtfields = rx(coarsePacketOffset + (ind.LSTF(1) : ind.LSIG(2)), :);
|
||||
finePacketOffset = wlanSymbolTimingEstimate(nonhtfields, chanBW);
|
||||
|
||||
packetOffset = coarsePacketOffset + finePacketOffset;
|
||||
|
||||
if packetOffset > 50
|
||||
if packetOffset > maxChDelay
|
||||
numPacketErrors = numPacketErrors + 1;
|
||||
continue;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user