Empirical ber must be a real vector between 0 and 1

1 次查看(过去 30 天)
When i use a line berfit(EbNoEncoderInput, BERVec(1,:)); i got a error like EMPBer must a real vector between 0 and 1
  3 个评论
Image Analyst
Image Analyst 2022-6-9
编辑:Image Analyst 2022-6-9
Then please check
maxValue = max(BERVec(1,:))
minValue = min(BERVec(1,:))
See documentation: berfit

请先登录,再进行评论。

回答(1 个)

Ayush
Ayush 2024-1-3
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

类别

Help CenterFile Exchange 中查找有关 Test and Measurement 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by