【发布时间】:2017-08-26 21:16:12
【问题描述】:
晚上好,
我正在尝试在 MATLAB 中编写以下方程,它是由两个高斯数组组成的瑞利分布。无论我做什么,它看起来都不接近标准化直方图或瑞利渐变的通用 pdf 分布:
所以,这就是我所做的。
x1 = randn(100000, 1);
% Create a second array of Gaussian random numbers
y1 = randn(100000, 1);
% Pass both Gaussian arrays through low pass filter and save to variable
x1_LPF = filter(LPF, 1, x1);
y1_LPF = filter(LPF, 1, y1);
% New Histograms of Raleigh distribution for filtered data
ray1 = abs(x1_LPF + j*y1_LPF);
figure('Name', 'Normalized Histogram of Raleigh Distribution')
[a, b] = hist(ray1, 100)
delta_x = b(3) - b(2)
% SIGMA left out in equation because it is equal to 1 in the problem
g = b .* exp((-b.^2) / 2) .* delta_x;
plot(b , g, 'b')
这给了我这个:
当它看起来像这样时,黑线:
【问题讨论】:
标签: matlab pdf plot histogram normalization