fftshift
Cyclic rotation for phase-zero windowing
// given a signal (an array) // => in-place rotation. 0 is now at the center of the array // => in-place rotation. Signal is now as before fftshift
Usage
Install via npm
:
npm install fftshift
Require in your code:
Example
// ES6 syntax // ES5 syntaxvar shift = shiftshift
API
Array
fftshift(buffer) ⇒ Zero-phase windowing alignment
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 |
Array
ifftshift(buffer) ⇒ Inverse of zero-phase windowing alignment
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 |
License
MIT License