program_04_2.m
来自「自编的一些小波源程序,用MATLAB编的.希望对那些喜欢小波的人有所帮助.去解压」· M 代码 · 共 17 行
M
17 行
% Program 4_2
% Set up the filter coefficients
colordef black;
b = [-6.76195 13.456335 -6.76195];
% Set initial conditions to zero values
zi = [0 0];
% Generate the two sinusoidal sequences
n = 0:99;
x1 = cos(0.1*n);
x2 = cos(0.4*n);
% Generate the filter output sequence
y = filter(b, 1, x1+x2, zi);
% Plot the input and the output sequences
plot(n,y,'r-',n,x2,'b--',n,x1,'g-.');grid
axis([0 100 -1.2 4]);
ylabel('Amplitude'); xlabel('Time index n');
legend('r-','y[n]','b--','x2[n]','g-.','x1[n]')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?