📄 firwin.m
字号:
function g=firwin(name,M,centering);%FIRWIN FIR window% Usage: g=firwin(name,M);% g=firwin(name,M,centering);%% FIRWIN(name,M) will return a FIR window of length M of type% name.%% FIRWIN(name,M,centering) will create a window centered as % specified by centering. The default (centering=0) is to return% a whole-point centered window, while a value of .5 will produce a% half-point even function (traditional signal processing style).%% The windows are normalized, such that if used for Gabor systems% with parameters a=M/2 and M, they will generate Gabor frames% with framebounds close to 1.%% All windows are symmetric and can be used for Wilson bases, except% when noted otherwise. %% The windows available are:%% hanning - Hanning window. Forms a PU.%% sqrthann - Square root of a Hanning window. Normalized so it% generates a normalized tight Gabor system with parameters% a=M/2 and M or an orthonormal Wilson/MDCT basis with M channels.%% hamming - Hamming window. Forms a PU. This window cannot% be used for a Wilson basis.%% sqrtham - Square root of a Hamming window. As sqrthan.%% blackman - Blackman window%% vorbis - Iterated sine window. This is a tight window.% % SEE ALSO: PGAUSS, PBSPLINE, FIRKAISER%% REFERENCES:% A. V. Oppenheim and R. W. Schafer. Discrete-time signal processing.% Prentice Hall, Englewood Cliffs, NJ, 1989.% % 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));if nargin==2 centering=0;end;name=lower(name);% This is the normally used sampling vector.x=((0:M-1)'+centering)/M;switch name case {'hanning'} g=(0.5+0.5*cos(2*pi*x)); case {'sqrthan','sqrthann'} g=sqrt(firwin('hanning',M,centering))/sqrt(M/2); case {'hamming'} g=0.54-0.46*cos(2*pi*(x-.5)); case {'sqrtham'} g=sqrt(firwin('hamming',M,centering)/1.08)/sqrt(M); case {'blackman'} g=0.42-0.5*cos(2*pi*(x-.5))+0.08*cos(4*pi*(x-.5)); case {'vorbis'} g=sin(pi/2*sin(pi*(x-.5).^2))/sqrt(M); otherwise error('Unknown window.');end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -