Empirical ber must be a real vector between 0 and 1

조회 수: 1 (최근 30일)
Sowmika M
Sowmika M 2022년 6월 9일
답변: Ayush 2024년 1월 3일
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