ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

《DSP using MATLAB》Problem 8.19

2019-06-24 18:50:20  阅读:258  来源: 互联网

标签:gca set %% manual 8.19 Analog using Problem 500


    代码:

%% ------------------------------------------------------------------------
%%            Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf('        <DSP using MATLAB> Problem 8.19 \n\n');

banner();
%% ------------------------------------------------------------------------

Wp = 500; Ws = 2000; Rp = 0.25; As = 50;

Ripple = 10 ^ (-Rp/20)
Attn = 10 ^ (-As/20)

% Analog filter design:
[b, a] = afd_elip(Wp, Ws, Rp, As);

% Calculation of second-order sections:
[C, B, A] = sdir2cas(b, a);

% Calculation of Frequency Response:
[db, mag, pha, ww] = freqs_m(b, a, 2500);

% Calculation of Impulse Response:
[ha, x, t] = impulse(b, a);


%% -------------------------------------------------
%%                    Plot
%% -------------------------------------------------  

figure('NumberTitle', 'off', 'Name', 'Problem 8.19 Analog Elliptic lowpass')
set(gcf,'Color','white'); 
M = 1.0;                          % Omega max

subplot(2,2,1); plot(ww, mag);  grid on; axis([-2100, 2100, 0, 1.2]);
xlabel(' Analog frequency in rad/sec units'); ylabel('|H|'); title('Magnitude in Absolute');
set(gca, 'XTickMode', 'manual', 'XTick', [-500, 0, 500, 2000]);
set(gca, 'YTickMode', 'manual', 'YTick', [0, 0.003, 0.97, 1]);

subplot(2,2,2); plot(ww, db);  grid on; %axis([0, M, -50, 10]);
xlabel('Analog frequency in rad/sec units'); ylabel('Decibels'); title('Magnitude in dB ');
set(gca, 'XTickMode', 'manual', 'XTick', [-500, 0, 500, 2000]);
set(gca, 'YTickMode', 'manual', 'YTick', [-50, -1, 0]);
set(gca,'YTickLabelMode','manual','YTickLabel',['50';' 1';' 0']);

subplot(2,2,3); plot(ww, pha/pi);  grid on; axis([-2100, 2100, -1.2, 1.2]);
xlabel('Analog frequency in rad/sec nuits'); ylabel('radians'); title('Phase Response');
set(gca, 'XTickMode', 'manual', 'XTick', [-500, 0, 500, 2000]);
set(gca, 'YTickMode', 'manual', 'YTick', [-1:0.5:1]);


subplot(2,2,4); plot(t, ha); grid on; %axis([0, 30, -0.05, 0.25]); 
xlabel('time in seconds'); ylabel('ha(t)'); title('Impulse Response');

  运行结果:

       通带、阻带绝对指标

        模拟Elliptical低通系统函数,串联形式系数

        直接形式系数

        幅度谱、相位谱和脉冲响应

        P8.12中的模拟Butterworth低通结果

 

标签:gca,set,%%,manual,8.19,Analog,using,Problem,500
来源: https://www.cnblogs.com/ky027wh-sx/p/11078772.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有