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

📄 c75.m

📁 matlab例程MATLAB 6.x版的内建数据类型(Built-in data type)就有5种以上
💻 M
字号:
% Step 1: Determine n             Wp=10; Ws=20; Gp=-2; Gs=-20             P1=-Gs/10;  P2=-Gp/10; Wsp=Ws/Wp;             Nc=log((10^P1-1)/(10^P2-1))/(2*log(Wsp));;             N=ceil(Nc)% Step 2: Detremine Wc                            Wc=Wp/(10^P2-1)^(1/(2*N));            % Alternate cutoff frequency            % Wc=Ws/(10^P1-1)^(1/(2*N));          % Step 3: Determine the normalized transfer function H(s)            for k=1:N            A=(2*(k-1)+N+1)/(2*N);            Sk=cos(A*pi)+j*sin(A*pi);            s=[s Sk];            end            s=s';            num1=[0 1];    den1=poly([s']);% Step 4: Determine the final filter transfer function H(s)            num2=[0 Wc^N]; den2=poly(Wc*[s']);            fprintf('filter order is n=%i\n',N)            fprintf('cutoff frequency of the filter is Wc=%4f\n',Wc)            disp('Poles of the transfer function are'),s            disp('The normalized fourth order transfer function is')            printsys(abs(num1),abs(den1))            disp('The transfer function with s replaced by s/Wc is')            printsys(abs(num2),abs(den2))% Step 5: Amplitude response of the filter            w=0:0.01:40; w=w';            [mag,phase,w]=bode(num2,den2,w);            plot(w,mag);          

⌨️ 快捷键说明

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