Skip to main content
10 events
when toggle format what by license comment
Oct 8, 2016 at 9:36 comment added msm @vvv I am glad it helped. Just updated the answer as you suggested.
Oct 8, 2016 at 9:35 history edited msm CC BY-SA 3.0
added 339 characters in body
Oct 8, 2016 at 9:21 vote accept vvv
Oct 8, 2016 at 9:21 comment added vvv Okay got it now, many thanks for your great help! Just a thought, it might be helpful to add your previous comment to your original answer as well, at least for me it did the trick (was confused about how to shift vectors).
Oct 8, 2016 at 3:03 comment added msm @vvv The answer I provided will require you to use linear shift, not circular shift. If you wan to use circular shift, then do it like the following: x=w.*rhat; phi=fft(circshift(x',M+1)'); where M is even and w and rhat are just the symmetric vectors around M+1 (for instance w=[2 4 6 4 2] is symmetric around M=3).
Oct 7, 2016 at 18:18 comment added vvv Thanks again. I'm almost there; I circularly shifted both vectors and ran the FFT. What I am wondering though is the scaling term. Consider, for example, that we are dealing with an autocorrelation function, i.e. $\hat{r}_{yy}$. My understanding is that in this case the periodogram values should be real-valued. This indeed is the case after running the FFT (up to very small imaginary terms due to numerical imprecisions, I suppose). However, if I scale these results with $e^{i \omega (M+1)}$ the results are obviously complex valued figures. Any idea what's up with this?
Oct 7, 2016 at 10:47 comment added msm You're welcome @vvv. We need $w'(k)=w(k-M-1)$ and $\hat{r}'_{yu}(k)=\hat{r}_{yu}(k-M-1)$. It means, both $w(k)$ and $\hat{r}_{yu}(k)$ should be shifted from $[-M, M]$ to $[1, 2M+1]$ such that the start of both are from $1$ rather than $-M$. When you did that, the inside of sum is consistent with the definition of FFT and you can calculate it. At the end, scale it with $e^{i\omega(M+1)}$
Oct 7, 2016 at 10:37 comment added vvv Thank's alot for your answer! Just to be clear, with "shifted vectors" do you mean a circular shift of the original vector so that the first M values are taken out and shifted to the end, so that the shifted vector starts with the value corresponding to M+1th value in the original vector? Or maybe something else? Now, practically speaking, if I were to calculate the part inside the sum notation with fft should I scale the result with a complex exponent $e^{i \omega (M+1)}$?
Oct 6, 2016 at 22:55 history edited msm CC BY-SA 3.0
added 2 characters in body
Oct 6, 2016 at 22:44 history answered msm CC BY-SA 3.0