【问题标题】:Rect Function/Square wave in MatLabMatLab中的矩形函数/方波
【发布时间】:2013-07-01 17:34:00
【问题描述】:

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

【问题讨论】:

  • 好的,这是Performing a Convolution in Matlab 的延续/重复,对吧?狭缝是在时域还是频域?狭缝的幅度是多少,1?
  • 是的,这是一个延续。狭缝在时域中。狭缝的幅度确实是1

标签: matlab math signal-processing convolution


【解决方案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 ) )

【讨论】:

  • 美丽。完全按照我的需要工作。
  • @JamesMaslek,很高兴听到这个消息!你的问题听起来很有趣,如果你有任何问题,我很乐意听到更多信息!
  • 谢谢!我其实还有一个问题。我很快就会在论坛上发布它。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-27
  • 2020-01-26
  • 1970-01-01
  • 2013-02-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多