📄 f14_7.m
字号:
%装载数据
load seat.dat -ascii
dt=0.005;
N=length(seat);
subplot(2,1,1);
plot((1:N)*dt,seat);
xlabel('时间 t / s');
ylabel('座椅质心响应');
nfft=1024;
y=abs(fft(seat,nfft));
fs=1/dt;
subplot(2,1,2);
plot((0:nfft/2-1)/nfft*fs,y(1:nfft/2));
xlabel('频率 f / Hz');
ylabel('功率谱 / W');
%d5小波进行4层分解
%一维小波分解
[c,l] = wavedec(seat,4,'db5');
%重构第1-4层细节系数
d4 = wrcoef('d',c,l,'db5',4);
d3 = wrcoef('d',c,l,'db5',3);
d2 = wrcoef('d',c,l,'db5',2);
d1 = wrcoef('d',c,l,'db5',1);
%显示细节号
figure(2);
subplot(4,1,1);
plot(d1,'LineWidth',2);
ylabel('d1');
subplot(4,1,2);
plot(d2,'LineWidth',2);
ylabel('d2');
subplot(4,1,3);
plot(d3,'LineWidth',2);
ylabel('d3');
subplot(4,1,4);
plot(d4,'LineWidth',2);
ylabel('d4');
xlabel('样本序号 n');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -