《DSP using MATLAB》Problem 6.18

《DSP using MATLAB》Problem 6.18

代码:

%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 6.18 \n\n'); banner();
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%format long;
format short;
fprintf('\n FIR filter DIRECT-form: \n');
b = [2, 3, 5, -3, 0, 4, 0, 8, -7, 4]
a = 1.0 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) % ----------------------------------------------------------
% NOTE: linear-phase can not use LATTICE-form
% ----------------------------------------------------------
fprintf('\nConvert DIRECT-form to All-Zero LATTICE-form : \n');
[Klc] = dir2latc(b) fprintf('\nConvert DIRECT-form to FREQUENCY-SAMPLE-form : \n');
[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 6.18

《DSP using MATLAB》Problem 6.18

《DSP using MATLAB》Problem 6.18

《DSP using MATLAB》Problem 6.18

《DSP using MATLAB》Problem 6.18

《DSP using MATLAB》Problem 6.18

上一篇:基本控件设置边角图片 drawableleft


下一篇:ansible-host file