fshift

Shifts the elements of an array by a (possibly non-integer) given number of elements.
6.4K 次下载
更新时间 2015/8/6

查看许可证

FSHIFT shifts the elements in a vector by a given number of elements, as CIRCSHIFT does. However, a non-integer shift value can be used, in which case the elements are shifted along the perfect (sinc-based) interpolation of the periodisation of the vector. For integer shift values, FSHIFT is equivalent to CIRCSHIFT to machine precision.
The syntax to FSHIFT is slightly different from CIRCSHIFT (FSHIFT expects only vectors for its first argument and a scalar for its second argument). Also, the second arguments produces a shift in the opposite direction of CIRCSHIFT to be consistent with the usual statement of the shift property of the Fourier transform.
FSHIFT works by introducing a linear phase into the vector's DFT. As such, if there is a discontinuity between the first and last elements of the input vector, the output vector may present significant ringing.

引用格式

Francois Bouffard (2024). fshift (https://www.mathworks.com/matlabcentral/fileexchange/7886-fshift), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R13
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.31.0.0

Simpler code that accomplishes the same for even-length inputs.

1.3.0.0

Fixed a bug with even-length complex inputs. Thanks to Ahmed Fasih for pointing out the problem.

1.2.0.0

Updated the author information in the file.

1.1.0.0

Bugfix: changed conjugate transpose for simple transpose, which fixes the shift direction reversal (e.g. with respect to Matlab's CIRCSHIFT). Thanks to Kamil Wojcicki for pointing out the problem.

1.0.0.0

Bug fix: results for vectors with an even length were slightly off for non-integer shifts. Sorry for the inaccuracies that this could have caused.