How to filter noisy function ?
显示 更早的评论
I have a gaussian function which outputs a 1-by-1001 matrix. It also has a noise. I want it to work 1000 times and to choose matrices with relatively less noise. Then, I want to create another matrix composed of the relatively less noisy matrices. How can I achieve this ?
function [gf] = two_stars_random(C1,x01,s1,C2,x02,s2,N)
randCoeff=0.5;
a=(1-randCoeff)+2*randCoeff*rand(1);
C1t = a*C1;
a=(1-randCoeff)+2*randCoeff*rand(1);
x01t = a*x01;
x02t = x02+(x01t-x01);
a=(1-randCoeff)+2*randCoeff*rand(1);
s1t=a*s1;
a=(1-randCoeff)+2*randCoeff*rand(1);
C2t = a*C2;
a=(1-randCoeff)+2*randCoeff*rand(1);
s2t=a*s2;
N=1000;
range_begin = 0;
range_end = 1;
x=range_begin:(1.0/N):range_end;
g1=C1t*exp(-(x-x01t).^2/(2*s1t^2));
g2=C2t*exp(-(x-x02t).^2/(2*s2t^2));
b=0.2*rand(1)*(C1t+C2t)*rand(1,N+1);
gf=g1+g2+b;
end
7 个评论
Jan
2018-8-11
It depends on what "relatively less noise" means and what kind of "compostion" you mean. Does the shown code help to understand what you want to achieve?
Yasemin Derme
2018-8-11
Image Analyst
2018-8-11
"create another matrix composed of the relatively less noisy matrices" How? Concatenate them? Add them? How are we supposed to know what "create" means to you? Also, I don't see a loop over 1000 iterations where you create various arrays and inspect and keep track of the actual noise in each one, so how can you select the N least noisy arrays?
Yasemin Derme
2018-8-12
Image Analyst
2018-8-12
I'll try to look at it later today. In the meantime, please add comments saying what each chunk of code is doing, and add the program where you call this function 1000 times and concatenate the results, if you have it.
Yasemin Derme
2018-8-12
Yasemin Derme
2018-8-12
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Beamforming and Direction of Arrival Estimation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!