Empirical ber must be a real vector between 0 and 1

1 visualización (últimos 30 días)
Sowmika M
Sowmika M el 9 de Jun. de 2022
Respondida: Ayush el 3 de En. de 2024
When i use a line berfit(EbNoEncoderInput, BERVec(1,:)); i got a error like EMPBer must a real vector between 0 and 1
  3 comentarios
Image Analyst
Image Analyst el 9 de Jun. de 2022
Editada: Image Analyst el 9 de Jun. de 2022
Then please check
maxValue = max(BERVec(1,:))
minValue = min(BERVec(1,:))
See documentation: berfit

Iniciar sesión para comentar.

Respuestas (1)

Ayush
Ayush el 3 de En. de 2024
Hi Sowmika,
I understand that you want to resolve the error stating EMPBer must be a real vector between 0 and 1”.
First step would be to ensure thatEbNoEncoderInput is a vector of Eb/N0 values (the ratio of bit energy to noise power spectral density) in dB and BERVec(1,:) is a vector of corresponding BER measurements for the Eb/N0 values. You can follow below steps to correct the error in your code:
  • Check Real Values: Ensure that BERVec(1,:) contains only real numbers, not complex numbers.
  • Range of Values: Make sure that all the elements in BERVec(1,:) are within the range of 0 to 1. BER cannot be negative or greater than 1, as it represents the ratio of the number of incorrect bits to the total number of transmitted bits.
  • No NaNs or Infs: Check for NaN (Not a Number) or Inf (Infinity) values in your BER vector, which are not valid input for berfit.
You can refer the pseudo code below to get an idea on how to implement above suggested methods:
% Check for real numbers
if ~isreal(BERVec(1,:))
error('BERVec must contain only real numbers.');
end
% Check for values within the range [0, 1]
if any(BERVec(1,:) < 0) || any(BERVec(1,:) > 1)
error('BERVec values must be between 0 and 1.');
end
% Check for NaNs or Infs
if any(isnan(BERVec(1,:))) || any(isinf(BERVec(1,:)))
error('BERVec must not contain NaN or Inf values.');
end
% If all checks pass, use berfit
berfit(EbNoEncoderInput, BERVec(1,:));
For more information on “berfit” function you can refer the documentation page given below:
Regards,
Ayush

Categorías

Más información sobre Test and Measurement en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by