wilorth.m
来自「Matlab时频分析工具箱,希望能对大家有所帮助啊」· M 代码 · 共 127 行
M
127 行
function [gamma]=wilorth(p1,p2,p3)%WILORTH Wilson orthonormal window.% Usage: gamma=wilorth(M,L);% gamma=wilorth(g,M);% gamma=wilorth(g,M,L);%% Input parameters:% g : Auxiliary window window function (optional).% M : Number of modulations.% L : Length of window (optional).% Output parameters:% gamma : Window generating an orthonormal Wilson basis.%% gamma=WILORTH(M,L) computes a nice window of length L generating a% Wilson or MDCT orthonormal basis with M frequency bands for signal of% length L.%% gamma=WILORTH(g,M) creates an orthonormal window from the window g, % g must be whole-point even.%% gamma=WILORTH(g,M,L) pads or truncates g to length L before% calculating the orthonormal window. gamma will also be of length L.%% The input window g must be whole-point even. If g is not whole-point% even, then reconstruction using the dual window will not be perfect.%% SEE ALSO: DWILT, WILDUAL, ISEVEN% This program is free software: you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation, either version 3 of the License, or% (at your option) any later version.% % This program is distributed in the hope that it will be useful,% but WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the% GNU General Public License for more details.% % You should have received a copy of the GNU General Public License% along with this program. If not, see <http://www.gnu.org/licenses/>.error(nargchk(2,3,nargin));wasrow=0;% Detect which parameters was entered, and do simple transformations.if nargin == 3 g=p1; M=p2; L=p3; if size(g,2)>1 if size(g,1)>1 error('g must be a vector'); else % g was a row vector. wasrow=1; g=g(:); end; end; assert_squarelat(M,M,1,'WILORTH',0); [b,N,L]=assert_L(L,length(g),L,M,2*M,'WILORTH'); % fir2iir is now safe. g=fir2iir(g,L); wasreal=isreal(g);else if numel(p1)>1 % First parameter is a vector. g=p1; M=p2; if size(g,2)>1 if size(g,1)>1 error('g must be a vector'); else % g was a row vector. wasrow=1; g=g(:); end; end; assert_squarelat(M,2*M,1,'WILORTH',0); [b,N,L]=assert_L(length(g),length(g),[],M,2*M,'WILORTH'); wasreal=isreal(g); else M=p1; L=p2; assert_squarelat(M,M,1,'WILORTH',0); [b,N,L]=assert_L(L,L,L,M,2*M,'WILORTH'); a=M; b=L/(2*M); % Create default window, a Gaussian. g=comp_pgauss(L,a/b,0); wasreal=1; end;end;a=M;b=L/(2*M);% Multiply by sqrt(2), because comp_cantight will return a normalized% tight frame, i.e. the framebounds are A=B=1 instead of A=B=2. This means% that the returned gamma only has norm=.701 and not norm=1.gf=comp_wfac(g,a,2*M);gammaf=comp_cantight_fac(gf,L,a,2*M);gamma=sqrt(2)*comp_iwfac(gammaf,L,a,2*M);if wasrow gamma=gamma.';end;if wasreal gamma=real(gamma);end;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?