首页 > 代码库 > 《DSP using MATLAB》示例Example4.6

《DSP using MATLAB》示例Example4.6

技术分享

用到的z变换的性质:

技术分享

技术分享

继续解题:

技术分享

技术分享

上代码:

b = [0,0,0, 0.25, -0.5, 0.0625]; a = [1, -1, 0.75, -0.25, 0.0625];               % polynomials coefficients
[delta,n] = impseq(0, 0, 7);

figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘Example4.6 Impulse Sequence‘)
set(gcf,‘Color‘,‘white‘); 
%subplot(2,1,1); 
stem(n,delta); title(‘Impulse sequence ‘);  xlabel(‘n‘); ylabel(‘delta(n)‘); grid on;

x_check_sequence = filter(b, a, delta);                                          % check sequence

x_ori_seq = [(n-2) .* (1/2) .^ (n-2) .* cos(pi*(n-2)/3)] .* stepseq(2, 0, 7);    % original sequence

  运行结果:

技术分享

技术分享

 

《DSP using MATLAB》示例Example4.6