Plotting Rician Fading Channel
6 次查看(过去 30 天)
显示 更早的评论
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/399144/image.png)
so far i have this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/399149/image.png)
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/399154/image.png)
Thanks.
0 个评论
采纳的回答
Swetha Polemoni
2020-11-4
编辑:Swetha Polemoni
2020-11-4
Hi Saad Khan,
You might want to smoothen the histogram.
Here is the example for understanding smoothening of histogram using "spline" command.
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 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!