我正在尝试获得宽度为 83.66 的方波。鉴于我正在使用反卷积,我希望它是准确的。这是我到目前为止所拥有的:
width = 83.66;
x = linspace(-400,400,10000);
a2 = 1.205e+004 ;
al = 1.778e+005 ;
b1 = 94.88 ;
c1 = 224.3 ;
d = 4.077 ;
measured = al*exp(-((abs((x-b1)./c1).^d)))+a2;
p = 33*sinc( (x)/(2*width) );
slit = abs(fftshift(ifft(p)));
我对数据进行了测量拟合,并希望用宽度为 83.66 的狭缝对其进行反卷积。我尝试构建它的傅立叶变换,然后使用ifft(),但这只是给了我一个增量函数。它可能是一个顶部有小波浪线的峰,但当我放大时我看不到它。另外,我的狭缝应该是 ~84 宽。
关于如何获得狭缝的准确表示的任何想法。我的另一个想法是这样的:
slit = zeros(length(x))
slit(1:1+width) = 1
最佳答案
因此,我将使用 rect
函数来设置狭缝,如下所示:
x = linspace(-400,400,10000);
width = 83.66;
% create a rect function
rect = @(x) 0.5*(sign(x+0.5) - sign(x-0.5));
% create the time domain slit function
rt = rect(x/83.66);
plot( x, rt);
% change it to a causal rect
x0 = width/2 + 20; % move the left edge to be 20 units to the right of the origin
plot( x, rect( (x-x0)/width ) )
关于matlab - MatLab 中的矩形函数/方波,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17410342/