subband sinr computation in 5G
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I have developed the code below to compute the subband sinr in a downlink 5G waveform. The waveform information is shown beside each variable. Basically, I have the waveforms of the signal, interference, and noise, and trying to compute the subband sinr in 13 resource block groups (RBGs), each RBG has 8 RBs. I feel I am missing something though. The sampling rate is 30720000 and Nfft is 2048; That results in a subcarrier spacing of 15 kHz (5G numerology 0). However, for a 20 MHz channel, number of subcarriers = 12 RBGs * 8 RBs * 12 Subcarriers + 1 RBG * 4 RBs * 12 subcarriers = 1200 subcarriers, which is larger than Nfft/2 = 1024! Any idea about this?
Thanks.
function [sinrdB] = sinr_fn(rxWaveform, intrxWaveform, noise, waveformInfo)
RMS = @(x) sqrt(mean(abs(x).^2));
%%
fs = waveformInfo.SamplingRate; % 30720000
Nfft = waveformInfo.Nfft; % 2048
RBG = 8*12*15000; % Resource block group
% *********************************************************************** %
%% Noise power
wbPnoise = RMS(noise)^2;
noisefft = fft(noise, Nfft);
psdnoise = (1/(fs*Nfft)) * abs(noisefft).^2;
subPnoise = zeros(13, 1);
for i = 1:length(subPnoise)
if(i == 13)
subPnoise(i) = sum(psdnoise( (i-1)*96+1 : (i-1)*96+4*12 ))*RBG;
else
subPnoise(i) = sum(psdnoise( (i-1)*96+1 : i*96 ))*RBG;
end
end
% *********************************************************************** %
%% wideband signal power
wbPsignal = RMS(rxWaveform)^2;
signalfft = fft(rxWaveform, Nfft);
psdSignal = (1/(fs*Nfft)) * abs(signalfft).^2;
subPsignal = zeros(13, 1);
for i = 1:length(subPsignal)
if(i == 13)
subPsignal(i) = sum(psdSignal( (i-1)*96+1 : (i-1)*96+4*12 ))*RBG;
else
subPsignal(i) = sum(psdSignal( (i-1)*96+1 : i*96 ))*RBG;
end
end
% *********************************************************************** %
%% Interference power
wbPint = RMS(intrxWaveform)^2;
intfft = fft(intrxWaveform, Nfft);
psdInt = (1/(fs*Nfft)) * abs(intfft).^2;
subPint = zeros(13, 1);
for i = 1:length(subPint)
if(i == 13)
subPint(i) = sum(psdInt( (i-1)*96+1 : (i-1)*96+4*12 ))*RBG;
else
subPint(i) = sum(psdInt( (i-1)*96+1 : i*96 ))*RBG;
end
end
% *********************************************************************** %
%% snr calculations
wbSINR = wbPsignal / (wbPint + wbPnoise);
wbSINR_dB = 10*log10(wbSINR);
subSINR = subPsignal ./ (subPint + subPnoise);
subSINR_dB = 10*log10(subSINR);
sinrdB = [wbSINR_dB; subSINR_dB];
% *********************************************************************** %
end
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Waveform Generation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!