📄 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 compute a two overlapping 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.%%- sqrthan - Square root of a Hanning window. Normalized so it% generates a normalized tight Gabor system with parameters% a=M/2 and M%%- 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.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'} g=sqrt(firwin('hanning',M,centering))/sqrt(M); 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 + -