I'm having trouble plotting rician pdf.
I have already managed to plot what i think is the empircal density funtction in a histogram.
What i need is a trace red line like this image:
so far i have this:
generated using this code:
u = 2;
s = sqrt(0.5);
% Generate in-phase component
X = normrnd( u, s, [1 randSamples]);
% Generate quadrature component
Y = normrnd( u, s, [1 randSamples]);
% Rician RV, S = sqrt( X^2 + Y^2 )
S = sqrt( X .^ 2 + Y .^ 2 );
% empirical probability density
[f,x] = ecdf(S);
ecdfhist(f,x, 20); hold on
How to get the red line?
This is the question for reference:
Thanks.

 채택된 답변

Swetha Polemoni
Swetha Polemoni 2020년 11월 4일
편집: Swetha Polemoni 2020년 11월 4일

0 개 추천

Hi Saad Khan,
You might want to smoothen the histogram.
Here is the example for understanding smoothening of histogram using "spline" command.
You might consider "ksdensity" for smoothening. Below code snippet is for better understanding.
k=5;
s = [randn(100,1); randn(100,1)+k];
histogram(s,'Normalization','probability')
[f,x] = ksdensity(s);
hold on
plot(x,f)
These might help you.

댓글 수: 4

Saad Khan
Saad Khan 2020년 11월 4일
Thank you for your reply. I'm afraid this isn't exatxly what I'm looking for.
I mainly just need to use the ricepdf command to draw the theortical pdf line over the histogram.
i.e. the red trace line following the trend of the histogram.
Hi
There is no ricepdf command in Matlab. You may find the following code snippet useful in plotting Rician Distribution
pd = makedist('Rician','s',2,'sigma',sqrt(2))
x=1:0.1:6;
k=pdf(pd,x)
plot(x,k)
Saad Khan
Saad Khan 2020년 11월 4일
Thank you!
Can you tell me which value corresponds to the K factor of 4 referred to in the question?
Swetha Polemoni
Swetha Polemoni 2020년 11월 4일
편집: Swetha Polemoni 2020년 11월 4일
Not sure about K factor.

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

추가 답변 (0개)

질문:

2020년 11월 1일

편집:

2020년 11월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by