资源描述
《测试技术与数据处理》 大作业——SZ1405048 王洛
南京航空航天大学
研究生实验报告
课程名称:测试技术与数字信号处理
学生姓名: 王洛
学生学号: SZ1405048
指导教师: 刘壮
2015年6月11日
1、A finite-duration sequence of length L is given as xn=1 , 0 ≤ n ≤ L - 10, otherwise ,
Determine the N-point DFT of this sequence for N≥L using MATLAB.
(L=12, N=120).
解:
—MATLAB 程序:
x=[1 1 1 1 1 1 1 1 1 1 1 1];
X=fft(x,120);
stem(abs(X))
—实验结果:
2、x(n)=R6(N), i.e. x(n)=u(n)-u(n-6), Determine the 8, 32 and 64-point FFT using MATLAB.
解:
—MATLAB 程序:
x=[1 1 1 1 1 1];
X8=fft(x,8);
figure(1)
stem(abs(X8))
title('8 点');
X32=fft(x,32);
figure(2)
stem(abs(X32))
title('32 点');
X64=fft(x,64);
figure(3)
stem(abs(X64))
title('64 点');
—实验结果:
3、Determine a FIR lowpass filter with N=21 by rectangular and Hamming window using MATLAB. The passband edge frequency is 0.25π.
解:
—MATLAB 程序:
figure(1)
w1=boxcar(22);
b1=fir1(21,0.25,w1);
freqz(b1,1)
title('21 点矩阵窗');
figure(2)
w2=hamming(22);
b2=fir1(21,0.25,w2);
freqz(b2,1)
title('21 点Hamming 窗');
—实验结果:
4、Determine a FIR lowpass filter with N=8 and 12 by rectangular window and frequency-sampling method using MATLAB. The passband edge frequency is 0.4π.
解:
—MATLAB 程序:
figure(1)
N=8;
m=0:N/2;
Wm=2*pi*m./N;
Ad=[Wm<=0.4*pi];
Hd=Ad.*exp(-j*0.5*N*Wm);
Hd=[Hd conj(fliplr(Hd(2:N/2)))];
h=real(ifft(Hd));
w=linspace(0,pi,1000);
H=freqz(h,[1],w);
plot(w/pi,20*log10(abs(H)));
title('8 点频率采样');
figure(2)
w1=boxcar(N+1);
b1=fir1(N,0.4,w1);
freqz(b1,1)
title('8 点矩阵窗');
figure(3)
N=12;
m=0:N/2;
Wm=2*pi*m./N;
Ad=[Wm<=0.4*pi];
Hd=Ad.*exp(-j*0.5*N*Wm);
Hd=[Hd conj(fliplr(Hd(2:N/2)))];
h=real(ifft(Hd));
w=linspace(0,pi,1000);
H=freqz(h,[1],w);
plot(w/pi,20*log10(abs(H)));
title('12 点频率采样');
figure(4)
w1=boxcar(N+1);
b1=fir1(N,0.4,w1);
freqz(b1,1)
title('12 点矩阵窗');
—实验结果:
5、Determine a FIR Chebyshew lowpass filter that the passband edge frequency is 400Hz and the stopband edge frequency is 800Hz using MATLAB. The sampling frequency is 2000Hz, its minimum passband attenuation is 3dB and minimum stopband attenuation is 40dB.
解:
—MATLAB 程序1:
fp=400;
fs=800;
ft=2000;
wp=fp*2/ft;
ws=fs*2/ft;
Rp=3;
Rs=40;
[N,Wn]=cheb1ord(wp,ws,Rp,Rs)
[b,a]=cheby1(N,Rp,Wn);
freqz(b,a,2000)
title('Chebyshev 低通滤波器');
—实验结果:
6、Determine a IIR lowpass filter using MATLAB. The passband edge frequency is 100Hz and the stopband edge frequency is 300Hz. The sampling frequency is 1000Hz, its minimum passband attenuation is 3dB and minimum stopband attenuation is 20dB.
解:
由于归一化频率应小于1,而采样频率为1000HZ,同时阻带截止频率应小
于通带截止频率,所以将通带截止频率改为了100HZ。
—MATLAB 程序:
fp=100;
fs=300;
ft=1000;
wp=fp*2/ft;
ws=fs*2/ft;
Rp=3;
Rs=20;
[N,Wn]=buttord(wp,ws,Rp,Rs,'s')
[b,a]=butter(N,Wn);
freqz(b,a,1000)
—实验结果:
7、Determine a IIR Chebyshew I lowpass filter that the passband edge frequency is 0.3π rad/s and the stopband edge frequency is 0.6π rad/s using MATLAB. The passband ripple is 1dB and stopband attenuation is 20dB.
解:
—MATLAB 程序:
wp=0.3;
ws=0.6;
Rp=1;
Rs=20;
[N,Wn]=cheb1ord(wp,ws,Rp,Rs,'s')
[b,a]=cheby1(N,Rp,Wn,'s');
freqz(b,a,1000)
title('Chebyshev I 低通滤波器');
—实验结果:
展开阅读全文