examp26.m

来自「ADSP TOOLBOX: Version 2.0 and gui m-file」· M 代码 · 共 13 行

M
13
字号

clc,echo on 
%EXAMPLE 26 
n=0:50;x=cos(0.2*pi*n);h=1:8;    % Signals x and h 
a=[1 zeros(1,7)];                % Filter coefficients 
yf=filter(h,a,x);                % Response using filter 
yc=conv(x,h);                    % yc is longer than x and h 
yt=yc(1:length(n));              % So, truncate and find error  
dtplot(n,yt,'o'),pause(2)        % Plot convolution response 
dtplot(n,yf,'o'),pause(2)        % Plot filter response
err=yf-yt;plot(n,err)            % Find and plot error
echo off %end of example

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?