ip_06_03.m

来自「Proakis《contemporarycommunication system」· M 代码 · 共 21 行

M
21
字号
% MATLAB script for Illustrative Problem 3, Chapter 6.
echo on
f_cutoff=2000;				% the desired cut-off frequency
f_stopband=2500;			% the actual stopband frequency
fs=10000;				% the sampling frequency
f1=2*f_cutoff/fs;			% the normalized passband frequency
f2=2*f_stopband/fs;			% the normalized stopband frequency
N=41;					% this number is found by experiment
F=[0 f1 f2 1];		
M=[1 1 0 0];				% describes the low-pass filter
B=remez(N-1,F,M);			% returns the FIR tap coefficients
% plotting command follows
figure(1);
[H,W]=freqz(B);
H_in_dB=20*log10(abs(H));
plot(W/(2*pi),H_in_dB);
figure(2);
plot(W/(2*pi),(180/pi)*unwrap(angle(H)));
% plot of the impulse response follows
figure(3);
stem([0:N-1],B);

⌨️ 快捷键说明

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