matlab中detcoef,1-D detail coefficients

This example shows how to obtain and plot the detail coefficients for an electrical current signal. This example uses zero-padding (see dwtmode).

Load the signal and select the first 3920 samples.

origmode = dwtmode('status','nodisplay');

dwtmode('zpd','nodisplay')

load leleccum;

s = leleccum(1:3920);

Perform the decomposition at level 3 using db1. Extract the detail coefficients at levels 1, 2, and 3 from the decomposition structure.

[c,l] = wavedec(s,3,'db1');

[cd1,cd2,cd3] = detcoef(c,l,[1 2 3]);

Plot the original signal.

plot(s)

title('Original signal')

ylim([0 1000])

c1ea07fdd2e7ee9a3eb64b51bb5aedaf.png

Plot the level 3 detail coefficients.

plot(cd3)

title('Level 3 detail coefficients (cd3)')

ylim([-60 60])

49ede093d37558facdd23fff98057960.png

Plot the level 2 detail coefficients.

plot (cd2)

title('Level 2 detail coefficients (cd2)')

ylim([-60 60])

ae0e0b6f97f040649f9643396b858f23.png

Plot the level 1 detail coefficients.

plot (cd1)

title('Level 1 detail coefficients (cd1)')

ylim([-60 60])

f7e338bc8ad23900308b546eaeaa595e.png

Restore the original extension mode.

dwtmode(origmode,'nodisplay')

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值