www.gusucode.com > signal 案例源码程序 matlab代码 > signal/DesignOfADifferentiatorExample.m

    %% Design of a Differentiator
% An ideal differentiator has a frequency response given by
% $D(\omega)=j\omega$. Design a differentiator of order 30 that attenuates
% frequencies above $0.9\pi$. Include a factor of $\pi$ in the amplitude
% because the frequencies are normalized by $\pi$. Display the zero-phase
% response of the filter.

% Copyright 2015 The MathWorks, Inc.


%%

b = firls(30,[0 0.9],[0 0.9*pi],'differentiator');

fvtool(b,1,'MagnitudeDisplay','zero-phase')