【 MATLAB 】信号处理工具箱之波形产生函数 tripuls

举报
李锐博恩 发表于 2021/07/15 05:53:52 2021/07/15
【摘要】 上篇博文写了:【 MATLAB 】信号处理工具箱之波形产生函数 rectpuls,这篇博文是tripuls,一看就是一个类型的,所以很简单的说下。 MATLAB文档中称tripuls为采样非周期三角波(Sampled aperiodic triangle)。 语法格式: 功能描述: 就不翻译了,简单明了,看了我的上篇博文一定能明白这都是啥意思。 使用第一种形...

上篇博文写了:【 MATLAB 】信号处理工具箱之波形产生函数 rectpuls,这篇博文是tripuls,一看就是一个类型的,所以很简单的说下。

MATLAB文档中称tripuls为采样非周期三角波(Sampled aperiodic triangle)。

语法格式:

功能描述:

就不翻译了,简单明了,看了我的上篇博文一定能明白这都是啥意思。

使用第一种形式,给一个简单的小例子:


      clc
      clear
      close all
      fs = 10e3;
      t = -1:1/fs:1;
      x = tripuls(t);
      plot(t,x);
      ylim([-0.2 1.2])
      xlabel('t/s');
      ylabel('amplititude');
      title('tripuls');
  
 

 

第二种形式给定了脉冲宽度,第三种不仅给定了脉宽,还给出了偏移度百分比。负号表示左偏,正号表示右偏。


      % Generate 200 ms of a symmetric triangular pulse with a sample rate of 10 kHz and a width of 40 ms
      clc
      clear
      close all
      fs = 10e3;
      t = -0.1:1/fs:0.1;
      w = 40e-3;
      x = tripuls(t,w);
      % Generate two variations of the same pulse:
      %
      % One displaced 45 ms into the past and skewed 45% to the left.
      tpast = -45e-3;
      spast = -0.45;
      xpast = tripuls(t-tpast,w,spast);
      % One displaced 60 ms into the future, half as wide, and skewed completely to the right.
      tfutr = 60e-3;
      sfutr = 1;
      xfutr = tripuls(t-tfutr,w/2,sfutr);
      % Plot the original pulse and the two copies on the same axes.
      plot(t,x,t,xpast,t,xfutr)
      ylim([-0.2 1.2])
  
 

 

 

文章来源: reborn.blog.csdn.net,作者:李锐博恩,版权归原作者所有,如需转载,请联系作者。

原文链接:reborn.blog.csdn.net/article/details/82885557

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。