However, I do know that the command X[k] = fftshift(fft(ifftshift(x[n])))*Ts
works, and produces the correct thing, because I have shown it in the graphs in the OP. Therefore, I must be able to show that
- $y[n]$ is an ifftshifted version of $x[n]$
- $X[k]$ is an fftshifted version of $Y[k]$.
In doingand so, I should this command must be able to express Eq. (4) in such a way that if ifftshift()
is first applied to my signal $x[n]$, then Eq. (5) (the Matlab fft) is applied, and finally fftshift()
is appliedequivalent to the result, then I should obtain exactly the expression for $X[k]$, given by Eq. (4).
I am not even sure howhave a feeling that there might be a way to mathematically represent these two operations (which essentially just swapuse the two halves ofshift theorem to show that if you circularly shift the vectors around)through ifftshift and fftshift then you can cancel the extra phase factors, and the fft can be applied.
As a quick sanity check so far, I can also verify thaton Eq. (6) is correct up to this pointso far, I can verify it by manually evaluating the two things for a simple test vector of six numbers: