《DSP using MATLAB》Problem 4.13

代码:

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

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

%% -------------------------------------------------
%%              X(z)  rational function
%% -------------------------------------------------

b0 = 2; b1 = 3;         % numerator coefficient
a1 = -1; a2 = 0.81;     % denumerator                 

[As, Ac, r, v0] = invCCPP(b0, b1, a1, a2)

%% ------------------------------------------------------------------------
%%       x(n)=Ac*(r^n)*cos(pi*v0*n)*u(n) + As*(r^n)*sin(pi*v0*n)*u(n)
%% ------------------------------------------------------------------------
n_start = 0; n_end = 19;
n = [n_start : n_end];

x = Ac * (r.^n) .* cos( pi * v0 .* n) .* stepseq(0, n_start, n_end) + As * (r.^n) .* sin(pi * v0 .* n ) .* stepseq(0, n_start, n_end)

b = [2, 3]; a = [1, -1, 0.81];
x_chk = filter(b, a, impseq(0, n_start, n_end))

figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘Problem 4.13 x(n)‘)
set(gcf,‘Color‘,‘white‘);
stem(n, x);
title(‘x(n)‘); grid on;

figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘Problem 4.13 X(z) pole-zero‘)
set(gcf,‘Color‘,‘white‘);
zplane(b, a);
title(‘pole-zero plot‘); grid on;

  应用P4.12中的invCCPP函数,计算系数如下:

序列的前20个样值:

原文地址:https://www.cnblogs.com/ky027wh-sx/p/8457459.html

时间: 2024-10-11 14:15:20

《DSP using MATLAB》Problem 4.13的相关文章

《DSP using MATLAB》Problem 5.13

1. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 5.13 \n\n');

《DSP using MATLAB》Problem 8.13

代码: %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 8.13 \n\n'); banner();

《DSP using MATLAB》Problem 3.1

先写DTFT子函数: function [X] = dtft(x, n, w) %% ------------------------------------------------------------------------ %% Computes DTFT (Discrete-Time Fourier Transform) %% of Finite-Duration Sequence %% Note: NOT the most elegant way % [X] = dtft(x, n,

《DSP using MATLAB》Problem 4.11

代码: %% ---------------------------------------------------------------------------- %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 4.11 \n\n'); banner

《DSP using MATLAB》Problem 6.12

代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 6.12 \n\n'); ba

《DSP using MATLAB》Problem 7.28

又是一年五一节,朋友圈都是晒名山大川的,晒脑袋的,我这没钱的待在家里上网转转吧 频率采样法设计带通滤波器,过渡带中有一个样点 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info about this m-file fprintf('\n*******************************************************

《DSP using MATLAB》Problem 9.4

只放第1小题. 代码: %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 9.4.1 \n\n'); b

《DSP using MATLAB》 Problem 2.3

本题主要是显示周期序列的. 1.代码: %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 2.3.1 \

《DSP using MATLAB》Problem 2.5

2.代码: %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 2.5.2 \n\n'); time_st