rectpuls
采样的非周期性矩形
说明
示例
生成矩形脉冲并对其进行位移
生成 200 毫秒的矩形脉冲,其采样率为 10 kHz,宽度为 20 毫秒。
fs = 10e3; t = -0.1:1/fs:0.1; w = 20e-3; x = rectpuls(t,w);
生成该脉冲的两个副本:
一个副本向过去位移 45 毫秒。
tpast = -45e-3; xpast = rectpuls(t-tpast,w);
一个副本向将来位移 60 毫秒,且宽度减半。
tfutr = 60e-3; xfutr = rectpuls(t-tfutr,w/2);
在同一坐标区上绘制原始脉冲和两个副本。
plot(t,x,t,xpast,t,xfutr) ylim([-0.2 1.2])
输入参数
t
— 采样时间
向量
单位矩形脉冲的采样时间,指定为向量。
数据类型: single
| double
w
— 矩形宽度
1
(默认) | 正数
矩形宽度,指定为正数。
输出参数
y
— 矩形脉冲
向量
单位幅值的矩形脉冲,以向量形式返回。
注意
非零幅值的区间定义为在右侧开放,即 rectpuls(-0.5)
= 1
,而 rectpuls(0.5)
= 0
。
提示
rectpuls
可与脉冲序列生成函数 pulstran
结合使用。
扩展功能
C/C++ 代码生成
使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。
版本历史记录
在 R2006a 之前推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)