首页 > 其他 > 详细

《DSP using MATLAB》Problem 6.9

时间:2018-09-09 10:16:20      阅读:240      评论:0      收藏:0      [点我收藏+]

    9月9日,我们怀念毛主席!

技术分享图片技术分享图片

技术分享图片

技术分享图片

代码:

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

banner();
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Klr = [-0.56  2/3  1/2];  
Clr = [ 0  0  0  1]; 

%format rat;
format short;
fprintf(‘\nConvert Lattice-Ladder-form to Direct-form :     \n‘);
[b, a] = ladr2dir(Klr, Clr)
fprintf(‘\nConvert matlab Lattice-Ladder-form to Direct-form :   \n‘);
[NUM, DEN] = latc2tf(Klr, Clr)



fprintf(‘\nConvert DIRECT-form to PARALLEL-form :     \n‘);
[C, Bp, Ap] = dir2par(b, a)
%C = 0;

fprintf(‘\nConvert DIRECT-form to CASCADE-form :     \n‘);
[b0, Bc, Ac] = dir2cas(b, a) 

fprintf(‘\nConvert TF-form to SOS-form :     \n‘);
[sos, g] = tf2sos(b, a)

fprintf(‘\nConvert DIRECT-form to LATTICE-LADDER-form :     \n‘);
[Klr, Clr] = dir2ladr(b, a) 

fprintf(‘\nConvert DIRECT-form to MATLAB LATTICE-LADDER-form :     \n‘);
[K, V] = tf2latc(b, a)

% -----------------------------------------
%     START check
% -----------------------------------------
n = [0:7];
delta = impseq(0, 0, 7)
%format long
format  short
hcas = casfiltr(b0, Bc, Ac, delta)

hpar = parfiltr(C, Bp, Ap, delta)

hladr = ladrfilt(Klr, Clr, delta)

hdir = filter(b, a, delta)
% -------------------------------------------
%       END check
% -------------------------------------------


figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘P6.9 hcas(n), hpar(n)‘)
set(gcf,‘Color‘,‘white‘); 
subplot(2,1,1); stem(n, hcas); 
xlabel(‘n‘); ylabel(‘hcas(n)‘);
title(‘hcas(n)‘);  grid on;
subplot(2,1,2); stem(n, hpar); 
xlabel(‘n‘); ylabel(‘hpar(n)‘);
title(‘hpar(n)‘);  grid on;

figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘P6.9 hladr(n) hdir(n)‘)
set(gcf,‘Color‘,‘white‘); 
subplot(2,1,1); stem(n, hladr); 
xlabel(‘n‘); ylabel(‘hladr(n)‘);
title(‘hladr(n)‘);  grid on;
subplot(2,1,2); stem(n, hdir);  
xlabel(‘n‘); ylabel(‘hdir(n)‘);
title(‘hdir(n)‘);  grid on;

  运行结果:

       直接形式系数

技术分享图片

        并联形式系数

技术分享图片

        串联形式系数

技术分享图片

技术分享图片

技术分享图片

 

《DSP using MATLAB》Problem 6.9

原文:https://www.cnblogs.com/ky027wh-sx/p/9612653.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!