?? c_anafb.m
字號:
function Y = C_anafb(X, N, a0, a1)
% C_anafb Tree structured analysis filter bank using IIR filter.
%
% Y = C_anafb(X, N);
% Y = C_anafb(X, N, a0, a1);
% ---------------------------------------------------------------------------% arguments:
% X the signal to be filtered, a real column vector of size Lx1
% L should have a factor N.
% N number of subbands, we should have N=2^k, k=1,2,..8,
% default value of N is 2.
% a0,a1 two optional parameters, give both or none.
% These are the values of a0 and a1 used in the IIR filterbank.
% ---------------------------------------------------------------------------
%----------------------------------------------------------------------
% Copyright (c) 1998. Karl Skretting. All rights reserved.
% Hogskolen in Stavanger (Stavanger University), Signal Processing Group
% Mail: karl.skretting@tn.his.no Homepage: http://www.ux.his.no/~karlsk/
%
% HISTORY:
% Ver. 1.0 27.03.1998 Karl Skretting, used in Master thesis 1998, HIS:
% "Kompresjon av seismiske data"
% Ver. 1.1 20.07.2000 KS: added optional arguments a0, a1
% Ver. 1.2 02.12.2002 KS: moved from ..\Frames to ..\FrameTools
%----------------------------------------------------------------------
Mfile='C_anafb';
% check input and output arguments, and assign values to arguments
if (nargin < 1);
error([Mfile,': function must have one input argument, see help.']);
end
if (nargin < 2)
N=2;
end
if (nargin < 4)
% the default values
a0=0.1576056086;
a1=0.6148404766;
end
if (isempty(find([2,4,8,16,32,64,128,256]==N)))
error([Mfile,': illegal value of N, see help.']);
end
[L,M]=size(X);
if (M ~= 1)
error([Mfile,': X should be a column vector, see help.']);
end
if (rem(L,N) ~= 0)
error([Mfile,': length of X should have a factor N, see help.']);
end
disp([Mfile,': Split into ',int2str(N),' subband ... ']);
K=log2(N);
Y=X;
for k=1:K
Y=C_ana(Y,a0,a1);
% switch columns to sort by frequency
Bytt=0;
for i=1:2:size(Y,2)
if (Bytt)
y=Y(:,i);
Y(:,i)=Y(:,i+1);
Y(:,i+1)=y;
end
Bytt = ~Bytt;
end
end
return
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -