Calculate Nakagami m parameter using the mle function

조회 수: 6 (최근 30일)
youcha
youcha 2021년 1월 2일
편집: Torsten 2022년 4월 18일
Hello,
I have generated a Nakagami distribution and a Gaussian distribution and added them together. The resulted signal called "Signal_total". Later, I applied a FIR filter on "Signal_total" and substructed the filtered signal from the "signal_total". The result of the substruction is called "fast_fading". The next step is to compute the m Nakagami parameter of the "fast_fading" using the mle function of matlab. The problem is matlab returns the following error:
Error using prob.NakagamiDistribution>nakafit (line 271)
The data in X must be positive
I want to know that this error comes from having negative values in the vector "fast_fading" But I do not know How to make them positive without changing their statistics? something like unit convertion o other thing
Here is my code:
pd_cp = makedist('Nakagami','mu',2,'omega',2);
R_cp = random(pd_cp1,5000,1);
pd_lp = makedist('Normal','mu',0,'sigma',1);
R_lp = random(pd_lp,5000,1);
Signal_total=R_cp+R_lp;
filtersize=5;
Mean_Pwr=filter(ones(1,filtersize)/filtersize,1,Signal_total);
fast_fading=Signal_total-Mean_Pwr;
fast_fading=fast_fading(filtersize:end);
phat(T,:)= mle(fast_fading,'distribution','Nakagami');
Thank you in advance.

답변 (1개)

Jeff Miller
Jeff Miller 2021년 1월 2일
I think the minimum change you need is
fast_fading=fast_fading(filtersize:end);
fast_fading = fast_fading - min(fast_fading); % Maybe also add eps if mle will not accept x=0
phat(T,:)= mle(fast_fading,'distribution','Nakagami');
This will change the mean of fast_fading but none of its other statistics.
  댓글 수: 3
Jeff Miller
Jeff Miller 2021년 1월 3일
Only the mean will change, not the standard deviation, skewness, kurtosis, etc. You can easily verify this by calling the appropriate functions before and after subtracting the min.
Perhaps even better, make histograms of the fast_fading values before and after the subtraction. The two histograms will look identical except for the labelling of the horizontal axis. After subtraction, the zero point on the x axis will be just at the minimum of the histogram.
youcha
youcha 2021년 1월 12일
A profesor told me to work with the envelope of the signal, this way I will have only positive values. However, I have a doubt: which one of these is correct to calculate the envelope is it the "[upper, lower]=envelope(signal)" function and take just the upper part later or just calculate the 10^(signal) ?

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by