以单频正弦信号为激励测量系统频率响应
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
以单频正弦信号为激励测量系统频率响应
一、实验目的
1.加深对LTI系统频率响应物理概念的理解
2.掌握测量LTI系统频率响应基本方法
3.掌握频率域采样法设计FIR滤波器的原理
4.掌握根据实际需求正确选择DFT参数的方法
二、实验原理与方法
三、源程序:
clear;
b=[0.0002,0.0002,-0.001,-0.0006,0.0023,0.0009,-0.0036,-0.0004,0.0042,-0.0004,-0.0036,0.0009, 0.0023,-0.0006,-0.001,0.0002,0.0002];
a=[1,2.675,7.8559,13.6147,23.8512,30.8819,39.641,40.2748,40.3641,32.5164,25.859,16.1752,10 .0665,4.5598,2.1127,0.5587,0.1695];
freqz(b,a);hold on;
n=0:1000;
w=zeros(1,500);
i=1;
for w0=0:.002:1;
x=cos(pi*w0*n);%令A=1;初相为0;
y=filter(b,a,x);
xw=fft(x,1024);
yw=fft(y,1024);
%figure;
%subplot(2,1,1);
%stem(0:1023,abs(xw));grid on;
%subplot(2,1,2);
%stem(0:1023,abs(yw));grid on;
h=max(abs(yw))/max(abs(xw));
H=20*log10(h);
w(i)=H;
i=i+1;
end
%subplot(2,1,1);
%stem(0:511,abs(xw));grid on;
%subplot(2,1,2);
%stem(0:511,abs(yw));grid on;
%figure
%w=polyfit(0:0.001:1,w,3);
plot(0:.002:1,w,'r');grid on;
a1=unwrap(angle(yw));
hold on;
subplot(2,1,2)
plot(0:1/1023:1,-a1);grid on;
%figure
%plot(0:1023,abs(yw));grid on;title('测量系统的幅频响应')
绘得图形:
00.10.20.30.40.50.60.70.80.91
-40-20
20
40
00.10.20.30.40.50.60.70.8
0.91
-150-100
-50
050
Normalized Frequency ( rad/sample)M a g n i t u d e (d B
)