对于自己的范围,类似于Matlab中的fftshift的移位索引 [英] Shifting indexes similar to fftshift in Matlab for own range

查看:76
本文介绍了对于自己的范围,类似于Matlab中的fftshift的移位索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此讨论中,fft的结果是索引(0:N-1). fftshift 只需将其转换为[(N/2:N-1)(0:(N/2-1))].

In this discussion, the result of fft is indices (0:N-1). fftshift simply converts that to [(N/2:N-1) (0:(N/2-1))].

我想将原始范围(O:N-1)转换为(t/N:t/N + 1),其中 t 是时间,并假设整数和除以 N . 我正在使用Galois向量作为我的数据类型. 使用Matlab中的内置功能是否可以实现? 您如何在Matlab中实现它?

I want to convert original range (O:N-1) to (t/N: t/N + 1), where t is time and assume integer and divisibel by N. I am using the Galois vectors as my datatype. Is this possible with built-in functions in Matlab? How can you achieve it in Matlab?

推荐答案

通常,给定data向量,如果要将某些a(0lt; = a< = N),您可以非常轻松地做到这一点:

In general, given a data vector, if you want to shift the range from 0:N-1 to [a:N-1 0:a-1] for some a (0<=a<=N), you can do it very easily:

N = 10;
a = 3;
data = rand(1,N); % Example data. Assumed range: 0:N-1
shiftedData = data([a+1:N 1:a]);

这篇关于对于自己的范围,类似于Matlab中的fftshift的移位索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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