《数字信号处理实验报告--滤波器对数字信号的影响》由会员分享,可在线阅读,更多相关《数字信号处理实验报告--滤波器对数字信号的影响(6页珍藏版)》请在金锄头文库上搜索。
1、数字信号处理数字信号处理实验报告实验报告实实 验验 名名 称:称: 滤波器对数字信号的影响 专专 业业 班班 级级 : 学学 生生 姓姓 名名 : 学学 号号 : 指指 导导 教教 师师 : 实实 验验 时时 间:间: 20112011 年年 6 6 月月 1515 日日 1 实验目的:证明各式滤波器对包括不同频率信号的响应2 运行环境:PC 机,windows2000 及其以上,matlab 软件。3 实验设计:Coeff_LF = 1; Coeff_MF = 0; Coeff_HF = 1; Coeff_NOISE = 0;F1 = 350; F2 = 600; F3 = 450;FS =
2、 2000; EndTime = 1/FS * 1023;Time = 0:1/FS:EndTime;N = length(Time)4 实验结果1 经过滤后信号的频域形成一条直线00.0050.010.0150.020.0250.030.0350.040.0450.05-0.1-0.0500.050.1TimeTime domain signals after BP filter-1000-800-600-400-2000200400600800100000.51Frequency2 带阻信号经过滤后时域和频域的波形图,01002003004005006007008009001000-800
3、-600-400-2000Frequency (Hz)Phase (degrees)01002003004005006007008009001000-300-200-1000Frequency (Hz)Magnitude (dB)Chebyshev Type I BandStop Filter3 在时域信号 BS 滤波器的波形图00.0050.010.0150.020.0250.030.0350.040.0450.05-2-1012TimeTime domain signals after BS filter-1000-800-600-400-2000200400600800100000.51
4、Frequency5 结论当 Rs 的值越大,信号失真越小,越精确。说明滤波器的性能越好。6 心得体会:本次课程设计中,本次课程设计中,通过实验对各种滤波器的认识进步加强,提高了动手能力。并提高了对 MATLAB 的认识,进一步了解了其功能的强大和运用和范围的广泛。7 实验代码:%实验设计程序如下function FilterSignalDemoCoeff_LF = 1; % Coefficient of low frequency signal F1(350 Hz)Coeff_MF = 0; % Coefficient of middle frequency signal F3(450 Hz
5、)Coeff_HF = 1; % Coefficient of High frequency signal F2(600 Hz)Coeff_NOISE = 0; % Coefficient of noise, such as 0(without noise), 1, sqrt(2), 3 and so on.F1 = 350; % HzF2 = 600; % HzF3 = 450; % HzFS = 2000; % Hz sample frequencyYBP = filter(b, a, SinSignal);figuresubplot(2,1,1)plot(Time, YBP)xlim(0
6、 0.05)xlabel(Time)title(Time domain signals after BP filter)FFTSinSignalSum = 2 / N * fft(YBP)subplot(2,1,2)FnSinSum = abs(FFTSinSignalSum); plot(FW(2:length(FW)*FS/pi/2, FnSinSum(2:length(FW)hold onplot(FW(2:length(FW)-2*pi)*FS/pi/2, FnSinSum(2:length(FW)xlim(-FS/2 FS/2)ylim(0 1)xlabel(Frequency)%-
7、BandStop Filter-figureWp = 400 500/1000; Ws = 420 480/1000;Rp = 3; Rs = 30;n,Wn = cheb1ord(Wp,Ws,Rp,Rs)b,a = cheby1(n,Rp,Wn,stop);freqz(b,a,512,2000); title(Chebyshev Type I BandStop Filter)YBS = filter(b, a, SinSignal);figuresubplot(2,1,1)plot(Time, YBS)xlim(0 0.05)xlabel(Time)title(Time domain sig
8、nals after BS filter)FFTSinSignalSum = 2 / N * fft(YBS)subplot(2,1,2)FnSinSum = abs(FFTSinSignalSum); plot(FW(2:length(FW)*FS/pi/2, FnSinSum(2:length(FW)hold onplot(FW(2:length(FW)-2*pi)*FS/pi/2, FnSinSum(2:length(FW)xlim(-FS/2 FS/2)ylim(0 1)xlabel(Frequency)return参考文献参考文献格式如下:(1书籍 2 文章例)1程佩青著, 数字信号处理教程 ,清华大学出版社,20012Sanjit K. Mitra 著,孙洪,余翔宇译, 数字信号处理实验指导书(MATLAB版) ,电子工业出版社,2005 年 1 月