This is where navigation should be.

FREQWIN - Frequency response window

Usage

H = freqwin(name,L,bw);

Description

freqwin(name,L,bw) returns a frequency window name of length L with the mainlobe -6dB (half height) bandwidth bw. It is intended to represent frequency response of a band-pass filter/window with bandwidth bw. The bandwidth is given in frequencies normalized to the Nyquist rate.

The function is not periodically wrapped should it be nonzero outside of the L samples (as opposed to e.g. pgauss).

The following windows can be used in place of name:

'gauss' Gaussian window
'gammatone' Gammatone window. The default order is 4. Custom order can be set by {'gammatone',order}.
'butterworth' Butterworth window. The default order is 4. Custom order can be set by {'butterworth',order}.

freqwin(name,L,bw,fs) does the same as above except bw is expected to be in Hz given sampling frequency fs.

freqwin understands the following key-value pairs and flags at the end of the list of input parameters:

'fs',fs If the sampling frequency fs is specified then the bw is expected to be in Hz.
'shift',s Shift the window by \(s\) samples. The value can be a fractional number.
'wp' Output is whole point even. This is the default. It corresponds to a shift of \(s=0\).
'hp' Output is half point even, as most Matlab filter routines. This corresponds to a shift of \(s=-.5\)

Additionally, the function accepts flags to normalize the output. Please see the help of setnorm. Default is to use 'peak' normalization.