《DSP using MATLAB》Problem 6.21

代码:

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

banner();
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%format long;
format short;

fprintf(‘\n FIR filter All-Zero LATTICE-form:     \n‘);
Klc = [2, 0.6, 0.3, 0.5, 0.9] 

% ----------------------------------------------------------
% NOTE: linear-phase can not use LATTICE-form
% ----------------------------------------------------------
fprintf(‘\nConvert All-Zero LATTICE-form to DIRECT-form :     \n‘);
[b] = latc2dir(Klc)
a = 1

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

if size(C)==0
  C = 0;
end

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 FREQUENCY-SAMPLE-form 1 :     \n‘);
[Cfs, Bfs, Afs] = dir2fs(b) 

fprintf(‘\nConvert DIRECT-form to FREQUENCY-SAMPLE-form 2 :     \n‘);
r = 0.99;
[Cfs_r, Bfs_r, Afs_r, rM] = dir2fs_r(b, r) 

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

hltc = latcfilt(Klc, delta)

%hladr = ladrfilt(Klr, Clr, delta)

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

  运行结果:

得到的直接形式系数

串联形式系数

频率采样形式1系数

频率采样形式2系数

Lattice和直接形式流图

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

时间: 2024-11-08 16:26:17

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

《DSP using MATLAB》Problem 4.21

快到龙抬头,居然下雪了,天空飘起了雪花,温度下降了近20°. 代码: %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB>

《DSP using MATLAB》Problem 5.21

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

《DSP using MATLAB》Problem 3.21

模拟信号经过不同的采样率进行采样后,得到不同的数字角频率,如下: 三种Fs,采样后的信号的谱 重建模拟信号,这里只显示由第1种Fs=0.01采样后序列进行重建,采用zoh.foh和spline三种方法: 原文地址:https://www.cnblogs.com/ky027wh-sx/p/8271297.html

《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.14

代码: %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 2.14 \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 7.15

用Kaiser窗方法设计一个台阶状滤波器. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> P

《DSP using MATLAB》Problem 7.28

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

《DSP using MATLAB》Problem 7.36

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