apowin

Provides a variety of apodization windows.

Syntax
w = apowin(Type,nPoints)
w = apowin(Type,nPoints,alpha)
Description

apowin returns an apodization window with nPoints point in the column vector w. WindowType is a character array specifying the window type. The available types are listed in the following table.

TypeNameFunction over [eqn]
barBartlett[eqn]
welWelch[eqn]
conConnes[eqn]
cosCosine[eqn]
hanHann[eqn]
hamHamming[eqn]
blaBlackman[eqn]
expExponential[eqn]
gauGaussian[eqn]
kaiKaiser[eqn]

The returned window is symmetric. If a '+' is appended to the three-letter type, only the right part of the symmetric window function ([eqn]) is returned. If a '-' is appended, the left part ([eqn]) is returned. E.g., 'exp+' thus specifies an exponential decay.

alpha is a parameter which is required for the Kaiser, Gaussian and exponential windows. Reasonable ranges for alpha are listed below.

Typealpha range
'exp'[eqn]
'gau'[eqn]
'kai'[eqn]
Examples

The following code plots the Kaiser windows for a range of alpha values.

y = []; n = 100;
for alpha = 3:9, y(:,end+1) = apowin('kai',n,alpha); end
plot(y);

The comparison between the Blackman, Cosine and Hann windows

n = 100; x = linspace(0,1,n);
wBla = apowin('bla+',n); wCos = apowin('cos+',n);
wHan = apowin('han+',n);
plot(x,wBla,x,wCos,x,wHan);
legend({'Blackman','Cosine','Hann'})

illustrates the difference in their behaviour at the right border.

See also

basecorr, datasmooth