资源描述:
《数字信号处理第三章.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、数字信号处理第三章实验程序3.1计算离散时间傅里叶变换%ProgramP3_1%EvaluationoftheDTFTclf;%ComputethefrequencysamplesoftheDTFTw=-4*pi:8*pi/511:4*pi;num=[21];den=[1-0.6];h=freqz(num,den,w);%PlottheDTFTsubplot(2,1,1)plot(w/pi,real(h));gridtitle('RealpartofH(e^{jomega})')xlabel('omega/pi')
2、;ylabel('Amplitude');subplot(2,1,2)plot(w/pi,imag(h));gridtitle('ImaginarypartofH(e^{jomega})')xlabel('omega/pi');ylabel('Amplitude');pausesubplot(2,1,1)plot(w/pi,abs(h));gridtitle('MagnitudeSpectrum
3、H(e^{jomega})
4、')xlabel('omega/pi');ylabel('Amplitude');su
5、bplot(2,1,2)plot(w/pi,angle(h));gridtitle('PhaseSpectrumarg[H(e^{jomega})]')xlabel('omega/pi');ylabel('Phaseinradians');Q3.1离散时间傅里叶变换的原始序列是H(e^jw)=(2+z^-1)/(1-0.6z^-1)。Pause的作用是暂停等待用户输入任意键后接着执行以下命令。Q3.2是周期函数,周期是2π。实部和幅度谱是关于y轴对称,是偶函数;虚部和相位谱是关于原点对称,是奇函数。Q3.3clf;
6、N=512;num=[0.7-0.50.31];den=[10.3-0.50.7];[h,w]=freqz(num,den,N);subplot(2,1,1)plot(w/pi,real(h));gridtitle('RealpartofH(e^{jomega})')xlabel('omega/pi');ylabel('Amplitude');subplot(2,1,2)plot(w/pi,imag(h));gridtitle('ImaginarypartofH(e^{jomega})')xlabel('ome
7、ga/pi');ylabel('Amplitude');pausesubplot(2,1,1)plot(w/pi,abs(h));gridtitle('MagnitudeSpectrum
8、H(e^{jomega})
9、')xlabel('omega/pi');ylabel('Amplitude');subplot(2,1,2)plot(w/pi,angle(h));gridtitle('PhaseSpectrumarg[H(e^{jomega})]')xlabel('omega/pi');ylabel('Ph
10、aseinradians');还是周期函数,周期是2π。相位谱的跳变的原因是:在利用反正切函数计算角度的时候,其中的一个分支出现了衰减,造成了跳变。clf;N=512;num=[0.7-0.50.31];den=[10.3-0.50.7];[h,w]=freqz(num,den,N);subplot(2,1,1)plot(w/pi,unwrap(angle(h)));gridtitle('PhaseSpectrumarg[H(e^{jomega})]')xlabel('omega/pi');ylabel('Phas
11、einradians');Q3.4修改后的程序为clf;w=-4*pi:8*pi/511:4*pi;num=[1357911131517];den=1;h=freqz(num,den,w);%PlottheDTFTsubplot(2,1,1)plot(w/pi,real(h));gridtitle('RealpartofH(e^{jomega})')xlabel('omega/pi');ylabel('Amplitude');subplot(2,1,2)plot(w/pi,imag(h));gridtitle('I
12、maginarypartofH(e^{jomega})')xlabel('omega/pi');ylabel('Amplitude');pausesubplot(2,1,1)plot(w/pi,abs(h));gridtitle('MagnitudeSpectrum
13、H(e^{jomega})
14、')xlabe