📄 5-6.m
字号:
%例程5-6 辨识FIR系统
% e.g.5-6.m for example5-6;
% to test function of tfestimate;
Fs=10^3;
t=0:1/Fs:1;
xn=randn(length(t),1);
b=ones(1,5)/5; %产生滤波器的系数
yn=filter(b,1,xn);
[h2,f]=tfestimate(xn,yn,[],256,128,Fs); %采用默认的汉明窗,长度为128
h1=freqz(b,1,f,Fs); %求实际的频率响应
subplot(211);
plot(f,abs(h1));
title('Actual Amplitude of Transfer Function ');
subplot(212);
plot(f,abs(h2));
title('Estimated Amplitude of Transfer Function ');
xlabel('f(Hz)');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -