在Matlab中进行FFT移位的有效方法(不使用fftshift函数) [英] Effcient way to do FFT shift in matlab (without using fftshift function)

查看:527
本文介绍了在Matlab中进行FFT移位的有效方法(不使用fftshift函数)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://www.mathworks.com/help/techdoc/ref/fftshift.html

如果您检查该链接-那就是我要在第一张图片中执行的操作-交换矩阵的象限.

If you check that link - thats what I want to do in the first picture - swap quadrants of a matrix.

但是,我似乎想不出一种好方法,而又没有几个循环来提取相关的子矩阵.

However, I cant seem to think of a good way to do this without having several loops to pull out the relevant sub-matrices.

我需要使用它来处理MxN个矩阵,其中M和N可以是偶数和奇数的任意组合.

I need it to work with MxN matrices, where M and N can be any combination of even and odd.

谢谢

推荐答案

如果在MATLAB的命令行中输入type fftshift.m,您将看到MATLAB实现该函数的源代码(如果需要,请使用edit fftshift.m在编辑器中查看它并突出显示语法).我没有在此处发布代码,因为它已受版权保护.但是,您可以在计算机上尝试使用它,然后在C中重新实现.如果您有任何许可条款,则由您自己决定许可条款等.

If you enter type fftshift.m at MATLAB's command line, you'll see the source code for MATLAB's implementation of the function (use edit fftshift.m if you want to view it in the editor with syntax highlighting). I'm not posting the code here, as it is copyrighted. However, you can try it on your machine and re-implement the same in C. Its up to you to figure out the license terms etc, if you're into any of that.

这篇关于在Matlab中进行FFT移位的有效方法(不使用fftshift函数)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆