Cyclic rotation for phase-zero windowing
> Cyclic rotation for phase-zero windowing

``js
import { fftshift, ifftshift } from 'fftshift'
// given a signal (an array)
fftshift(signal) // => in-place rotation. 0 is now at the center of the array
ifftshift(signal) // => in-place rotation. Signal is now as before fftshift
`
Install via npm:
`bash`
npm install fftshift
Require in your code:
Example
`js
// ES6 syntax
import { fftshift, ifftshift } from 'fftshift'
// ES5 syntax
var shift = require('fftshift')
shift.fftshift(signal)
shift.ifftshift(signal)
`
__CAUTION__: this function mutates the array
Perform a cyclic shifting (rotation) to set the first sample at the middle
of the buffer (it reorder buffer samples from (0:N-1) to [(N/2:N-1) (0:(N/2-1))])
Named by the same function in mathlab: fftshift`
Returns: Array - the same buffer (with the data rotated)
| Param | Type |
| --- | --- |
| buffer | Array |
__CAUTION__: this function mutates the array
Kind: static method of fftshift
Returns: Array - the same buffer (with the data rotated)
See: fftshift
| Param | Type |
| --- | --- |
| buffer | Array |
MIT License