matlab中envelope语法,Signal envelope

Create a two-channel signal sampled at 1 kHz for 3 seconds:One channel is an exponentially decaying sinusoid. Specify a frequency of 7 Hz and a time constant of 2 seconds.The other channel is a time-displaced Gaussian-modulated chirp with a DC value of 2. Specify an initial chirp frequency of 30 Hz that decays to 5 Hz after 2 seconds.

Plot the signal.

t = 0:1/1000:3;

q1 = sin(2*pi*7*t).*exp(-t/2);

q2 = chirp(t,30,2,5).*exp(-(2*t-3).^2)+2;

q = [q1;q2]';

plot(t,q)

5d6cc7c82764640c7a1a7b4040660837.png

Compute the upper and lower envelopes of the signal. Use a Hilbert filter with a length of 100. Plot the channels and the envelopes. Use solid lines for the upper envelopes and dashed lines for the lower envelopes.

[up,lo] = envelope(q,100,'analytic');

hold on

plot(t,up,'-',t,lo,'--')

hold off

d24a4b3241374ee756901c08cf16a9a7.png

Call envelope without output arguments to produce a plot of the signal and its envelopes as a function of sample number. Increase the filter length to 300 to obtain a smoother shape. The 'analytic' flag is the default when you specify two input arguments.

envelope(q,300)

64821eab7829fa384f3cf9316e9765c4.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值