《DSP using MATLAB》Problem 6.18
Posted ky027wh-sx
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了《DSP using MATLAB》Problem 6.18相关的知识,希望对你有一定的参考价值。
代码:
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info about this m-file fprintf(‘ *********************************************************** ‘); fprintf(‘ <DSP using MATLAB> Problem 6.18 ‘); banner(); %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %format long; format short; fprintf(‘ FIR filter DIRECT-form: ‘); b = [2, 3, 5, -3, 0, 4, 0, 8, -7, 4] a = 1.0 fprintf(‘ Convert DIRECT-form to PARALLEL-form : ‘); [C, Bp, Ap] = dir2par(b, a) if size(C)==0 C = 0; end fprintf(‘ Convert DIRECT-form to CASCADE-form : ‘); [b0, Bc, Ac] = dir2cas(b, a) fprintf(‘ Convert TF-form to SOS-form : ‘); [sos, g] = tf2sos(b, a) % ---------------------------------------------------------- % NOTE: linear-phase can not use LATTICE-form % ---------------------------------------------------------- fprintf(‘ Convert DIRECT-form to All-Zero LATTICE-form : ‘); [Klc] = dir2latc(b) fprintf(‘ Convert DIRECT-form to FREQUENCY-SAMPLE-form : ‘); [Cfs, Bfs, Afs] = dir2fs(b) % ----------------------------------------- % 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 % -------------------------------------------
运行结果:
以上是关于《DSP using MATLAB》Problem 6.18的主要内容,如果未能解决你的问题,请参考以下文章
《DSP using MATLAB》Problem 3.12