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

标签 matlab math signal-processing convolution

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

相关文章:

matlab - 如何在Matlab中手动分割和标记图像中的ROI?

java - 无控制结构的校验值

c++ - OpenGL圆形绘图得到一个椭圆

python - 在 Python 中使用 LombScargle 对 HRV 数据进行频谱分析

matlab - 在 MATLAB 中平滑 2D 图

python - 从向量中动态追加和删除元素

algorithm - 所有可能的 N 选择 K 没有递归

c# - 在 C# 中使用 System.Decimal 进行数学运算

matlab - 在我的傅里叶逆变换中出现尖峰

math - 如何确定我的卷积是否可分离?