Twisting a sequence on Matlab

Discussion in 'Homework Help' started by tquiva, Sep 20, 2011.

  1. tquiva

    Thread Starter Member

    Oct 19, 2010
    I am given the problem:


    I know that the pseudocode for when a sequence is shifted, it's Fourier transform will be twisted as a opposed to when the sequence is not shifted:

    F{x[*-n], exp(-i*2*pi*f*n)*X(f)}

    So I tried working the above problem with the following code:

    Code ( (Unknown Language)):
    1. % (a)
    2. star=-10:10; f=-1/2:0.01:1/2-0.01; % Star & frequency intervals
    3. % Let x
    4. [*] be bbox
    5. x=(abs(star-2)<=5);
    6. y=exp(i*2*pi*2*star).*x;
    7. X=x*exp(-i*2*pi*star'*f);
    8. Y=y*exp(-i*2*pi*star'*f);
    9. subplot(221),plot(star,x,'o'),xlabel('*'),ylabel('x
    10. [*]')
    11. subplot(222),plot3(f,real(X),imag(X))
    12. subplot(223),plot3(star,real(y),imag(y))
    13. subplot(224),plot3(f,real(Y),imag(Y))
    Now, I took a look at the problem again, and now I become confused. I chose an arbitrary equation for x
    [*] and twisted this equation by shifting it (in terms of star). The graphs don't seem correct.

    Could someone please help me?