MATLAB数字信号处理基础
1、波形产生函数
函数 | 说明 |
---|---|
square | 方波 |
sawtooth | 锯齿波 |
sinc | sinc函数 |
diric | diric函数 |
rectpuls | 非周期方波 |
tripuls | 非周期三角波 |
pulstran | 脉冲序列 |
chirp | 调频余弦波 |
-
square函数:调用方式如下:
-
x = square(t):产生周期为2pi、幅度最大值为1的方波。
-
x = square(t, duty):产生周期为2pi、幅度最大值为1的方波,duty为占空比。
用square函数产生周期为1,占空比分别为50%和30%的方波:
t = 0:0.001:4; y1 = square(2*pi*t); y2 = square(2*pi*t, 30); subplot(1, 2, 1); plot(t, y1); subplot(1, 2, 2); plot(t, y2); axis([0, 4, -1.5, 1.5]);
-
-
sawtooth函数: 调用方式如下:
- x = sawtooth(t, width):产生周期为2pi、峰值为1的锯齿波,width表示该位置横坐标与周期的比值。
用sawtooth函数产生周期为1的锯齿波和方波:
t = 0:0.001:4; y1 = sawtooth(2*pi*t); y2 = sawtooth(2*pi*t, 0.5); subplot(1, 2, 1); plot(t, y1); subplot(1, 2, 2); plot(t, y2); axis([0, 4, -1, 1]);
-
sinc函数: 调用方式如下:
- x = sinc(t):产生sinc函数波形。
用sinc函数产生波形:
t = -5:0.001:5; y = sinc(t); plot(t,y); axis([-5 5 -1 1]);