k-Wave Toolbox |

# getWin

Return a frequency domain windowing function

## Syntax

    win = getWin(N, type)
    win = getWin(N, type, ...)
    [win, cg] = getWin(N, type)
    [win, cg] = getWin(N, type, ...)

## Description

`getWin` returns a 1-,2-, or 3-D frequency domain window of the specified type of the given dimensions. By default, higher dimensional windows are created using the outer product. The windows can alternatively be created using rotation by setting the optional input `'Rotation'` to `true`. The coherent gain of the window can also be returned. Several examples are given below.

    getWin(32, 'Hanning', 'Plot', true);

    getWin(32, 'Hanning', 'Plot', true, 'Symmetric', false);

    getWin([32, 32], 'Gaussian', 'Plot', true);

    getWin([30, 40], 'Gaussian', 'Plot', true, 'Rotation', true);

## Inputs

`N` | number of samples, use `N = Nx` for 1-D `N = [Nz Nx]` for 2-D `N = [Nz Nx Ny]` for 3-D
`type` | window type. Supported values are `'Bartlett'` `'Bartlett-Hanning' `'Blackman'` `'Blackman-Harris'` `'Blackman-Nuttall'` `'Cosine'` `'Flattop'` `'Gaussian'` `'HalfBand'` `'Hamming'` `'Hanning'` `'Kaiser'` `'Lanczos'` `'Nuttall'` `'Rectangular'` `'Triangular'` `'Tukey'``

## Optional Inputs

Optional 'string', value pairs that may be used to modify the default computational settings.

Input | Valid Settings | Default | Description
--- | --- | --- | ---
`'Plot'` | (boolean scalar) | `false` | Boolean controlling whether the window is displayed.
`'Param'` | (numeric scalar) | `0.16 ('Blackman')` `0.5 ('Gaussian')` `3 ('Kaiser')` `0.5 ('Tukey')` | Control parameter for the Blackman, Gaussian, Kaiser, and Tukey windows.
`'Rotation'` | (boolean scalar) | `false` | Boolean controlling whether 2D and 3D windows are created via rotation or the outer product. Windows created via rotation will have edge values outside the window radius set to zero.
`'Symmetric'` | (boolean scalar) | `true` | Boolean controlling whether the window is symmetrical. If set to false, a window of length N + 1 is created and the first N points are returned.
`'Square'` | (boolean scalar) | `false` | Boolean controlling whether the window is forced to be square. If set to true and Nx and Nz are not equal, the window is created using the smaller variable, and then padded with zeros.

## Outputs

`win` | window
`cg` | coherent gain of the window

## Examples

- Image Reconstruction With Compensation For Acoustic Absorption
- Source Smoothing

© 2009, 2010, 2011 Bradley Treeby and Ben Cox.