⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex_07_01_1.m

📁 清华大学胡广书教授< 数字信号处理理论算法实现>>第二版一书的配套题解和电子课件一书《数字信号处理题解及电子课件》(2007年5月出版)的matlab源程序。
💻 M
字号:
%  ex_07_01_1.m :  习题 7.1

clear all;
close all;
 
N=28;
wn=0.25;
b1=fir1(N,wn,'stop',boxcar(N+1));
b2=fir1(N,wn,'stop',hamming(N+1));
 
[h1,w1]=freqz(b1,1,256,1);
[h2,w2]=freqz(b2,1,256,1);
 
n=0:N;
figure('color','w');
 
subplot(2,2,1)
stem(n,b1,'.');
xlabel('boxcar');
grid on;
 
subplot(2,2,3)
plot(w1,abs(h1));
xlabel('w/2\pi');
ylabel('Amplitude')
axis([0 0.5 0 1.2]);
grid on;
 
 
subplot(2,2,2)
stem(n,b2,'.');
xlabel('hamming');
grid on;
subplot(2,2,4)
plot(w2,abs(h2));
grid on;
xlabel('w/2\pi');
ylabel('Amplitude')
axis([0 0.5 0 1.2]);
 
figure('color','w');
subplot(2,2,1)
plot(w1,unwrap(angle(h1)));
grid on;
xlabel('w/2\pi');
ylabel('Phase(degrees)');
axis([0 0.5 -40 0]);
subplot(2,2,2)
plot(w2,unwrap(angle(h2)));
grid on;
xlabel('w/2\pi');
ylabel('Phase(degrees)');
axis([0 0.5 -40 0]);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -