【发布时间】:2017-08-24 15:18:06
【问题描述】:
我正在尝试将fourier phase shift theorem 应用于 R 中的复杂信号。但是,只有我的信号幅度会按照我的预期发生变化。我认为应该可以将这个定理应用于复杂信号,所以我可能在某个地方犯了错误。我的猜测是我计算的频率轴有误差。
如何正确地将傅里叶位移定理应用于复信号(使用 R)?
i = complex(0,0,1)
t.in = (1+i)*matrix(c(1,0,0,0,0,0,0,0,0,0))
n.shift = 5
#the output of fft() has the mean / 0 frequency at the first element
#it then increases to the highest frequency, flips to negative frequencies
#and then increases again to the negative frequency closest to 0
N = length(t.in)
if (N%%2){#odd
kmin = -(N-1)/2
kmax = (N-1)/2
} else {#even
kmin = -N/2
kmax = N/2-1
#center frequency negative, is that correct?
}
#create frequency axis for fft() output, no sampling frequency or sample duration needed
k = (kmin:kmax)
kflip = floor(N/2)
k = k[c((kflip+1):N,1:kflip)]
f = 2*pi*k/N
shiftterm = exp( -i*n.shift*f )
T.in = fft(t.in)
T.out = T.in*shiftterm
t.out = fft(T.out, inverse=T)/N
par(mfrow=c(2,2))
plot(Mod(t.in),col="green");
plot(Mod(t.out), col="red");
plot(Arg(t.in),col="green");
plot(Arg(t.out),col="red");
如您所见,信号幅度发生了很好的变化,但相位被打乱了。我认为负频率是我的错误所在,但我看不到它。
我做错了什么?
我能找到的关于傅立叶相移定理的问题:
math question about what fourier shift does
但这些与复杂信号无关。
【问题讨论】:
-
如果幅度为零(机器精度),那么相位不会告诉你太多。第 6 项的相位是否正确?
-
@Steve 没想到会这样,你说得对!您认为我可以按原样使用我的移位信号,还是应该将其设置为 0
Mod(t.out) < .Machine$double.eps?另外,请注意将其作为答案,还是应该删除该问题? -
也许this solution 是标记为重复而不是删除问题的好人选?
-
不,这不是关于相移定理,而是关于重新排列 fft 元素以供某些函数使用。有一些类似的问题,但没有一个是关于复杂信号的。等等,我会在帖子中添加一些链接。
-
随意将您的研究放在一起作为答案。
标签: r time signal-processing fft phase