gpt4 book ai didi

matlab - MatLab 中的矩形函数/方波

转载 作者:行者123 更新时间:2023-12-04 04:51:15 25 4
gpt4 key购买 nike

我正在尝试获得宽度为 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);

rect
% 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 ) )

shift rect

关于matlab - MatLab 中的矩形函数/方波,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17410342/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com