How can I find the solution of the integral

1 view (last 30 days)
Hakan Balaban
Hakan Balaban on 16 May 2020
Answered: Himanshu on 25 Nov 2024
How Can I find the SEP values for the range of SNRdB=-5:45 dBm for M-FSK in Rayleigh channel with the integrals below.
Thanks for help,
I have tried with these codes but I think something is wrong ?
% MFSK in Rayleigh channel - Theoretical SER calculation for M=4
r1=2;%degrees oof freedom for chi-square random variable
var1=2.*r1; %variance of chi-squared
SNRsymbolLin_4fsk = SNRbitLin * log2(modLevel_1);
q11 = @(y) integral(exp((-(y-sqrt(2.*x)).^2)/2).*(1./(SNRsymbolLin_4fsk.*2.*var1)).*exp(-(x./(SNRsymbolLin_4fsk.*2.*var1)),0,inf,'ArrayValued',true));
theorySer_rayleigh_4fsk= (1/sqrt(2.*pi).*integral(@(y) q11(y)*(1-(1-qfunc(y)).^3),-inf,inf,'ArrayValued',true));
and the related formulas I have used is ;

Answers (1)

Himanshu
Himanshu on 25 Nov 2024
Hey Hakan,
The issue in the previous code might be related to the incorrect calculation of SNRLin from SNRdB. The formula for converting from decibels to linear scale is correct, but ensure that the calculation is implemented properly in the code.
You may try the following to get your MATLAB code to correctly implement the given integral.
% Parameters
M = 4; % Modulation order for M-FSK
SNRdB = -5:45; % SNR range in dB
SNRLin = 10.^(SNRdB/10); % Convert SNR to linear scale
% Variance for Rayleigh channel
sigma = 1; % Assuming unit variance for simplicity
% Preallocate array for theoretical SER
theorySer_rayleigh_4fsk = zeros(size(SNRdB));
% Loop over each SNR value
for i = 1:length(SNRdB)
SNRsymbolLin = SNRLin(i) * log2(M);
% Define the inner integral function
q11 = @(y, x) exp(-((y - sqrt(2*x)).^2) / 2) .* ...
(1 / (SNRsymbolLin * 2 * sigma^2)) .* ...
exp(-x / (2 * SNRsymbolLin * sigma^2));
% Define the outer integral function
outerIntegral = @(y) (1 - (1 - qfunc(y)).^(M-1)) .* ...
integral(@(x) q11(y, x), 0, inf, 'ArrayValued', true);
% Compute the theoretical SER using double integration
theorySer_rayleigh_4fsk(i) = (1 / sqrt(2 * pi)) * ...
integral(@(y) outerIntegral(y), -inf, inf, 'ArrayValued', true);
end
% Plot the results
figure;
semilogy(SNRdB, theorySer_rayleigh_4fsk, 'b-o');
xlabel('SNR (dB)');
ylabel('Symbol Error Probability');
title('Theoretical SER for 4-FSK in Rayleigh Channel');
grid on;
The above code represents a mathematical expression for calculating the probability of symbol error ( P_s ) in a communication system. It involves a double integral where the outer integral is over ( y ) and the inner integral is over ( x ). The expression includes the complementary error function ( Q(y) ), the signal-to-noise ratio in linear scale ( \text{SNRLin} ), and a Gaussian function. The SNR is converted from decibels to linear scale using ( \text{SNRLin} = 10^{\left(\frac{\text{SNRdB}}{10}\right)} ), where (\text{SNRdB} = -5.45).
Hope this helps!

Categories

Find more on Propagation and Channel Models in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!