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

📄 mpfreq.m

📁 里面囊括了基于matlab滤波器设计的各种.m文件
💻 M
字号:
 
% MPFREQ(B,A,color)
%
% This function is used to plot the amplitude response of filter
% or signal. A logarithmic (base 10) scale is used for the Y-axis.
% X-axis is normalized freqency from 0 to 0.5. The color will be
% the one specified in argument. If there is no color specification,
% the color will be white.
%
% See DPLOT

function mpfreq(B,A)

 %[F,W]=freqz(B,A,1000,'whole');
 [F,W]=freqz(B,A,1000);

 W=linspace(0,0.5,1000);
 phase = angle(F);
 F = abs(F);
 %F = dbvalue(F./max(F));
 F = dbvalue(F);
 subplot(2,1,1)
 plot(W,F,'c')
 
 %axis([0,0.5,5,mi
 %==========================================
 % To show the top of the filter
 % V = axis;
 % axis([0,0.5,V(3),V(4)+20]);
 %==========================================

 %==========================================
 % To plot 6dB straight line
 % hold on
 % semilogy(W,0.5012*ones(1,1000),'g');
 % hold off
 %==========================================

 xlabel('Normalized Frequency');
 ylabel('Magnitude(dB)');
 subplot(2,1,2)
 plot(W,phase,'r')
 xlabel('Normalized Frequency');
 

⌨️ 快捷键说明

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