for kl=1:64 x(kl)=sin((kl)*pi/64.0)+sin((kl)*pi/32.0); end plot (x) z=fft(x); whos Name Size Elements Bytes Density Complex kl 1 by 1 1 8 Full No x 1 by 64 64 512 Full No z 1 by 64 64 1024 Full Yes bar(z) figure figure(2) bar(x) z=fft(x); figure(1) bar(real(z)) z=fftshift(y); bar(z) WARNING: Complex parts of X and/or Y arguments ignored. bar(imag(y)) bar(abs(y)) plot(fftshift(x)) plot(x,'.',fftshift(x),'-') for kl=1:64 u(kl)=(kl)*pi/64.0; x(kl)=sin((kl)*pi/64.0); x(kl)=x(kl)+1/2*sin(2*(kl)*pi/64.0)+1/3*sin(3*(kl)*pi/64.0)+1/4*sin(4*(kl)*pi/64.0); x(kl)=x(kl)+1/5*sin(5*(kl)*pi/64.0)+1/6*sin(6*(kl)*pi/64.0)+1/7*sin(7*(kl)*pi/64.0); x(kl)=x(kl)+1/8*sin(8*(kl)*pi/64.0)+1/9*sin(9*(kl)*pi/64.0)+1/10*sin(10*(kl)*pi/64.0); end plot(u,x,'.',u,fftshift(x),'-') z=fft(fftshift(x)); whos Name Size Elements Bytes Density Complex ans 1 by 5 5 80 Full Yes kl 1 by 1 1 8 Full No u 1 by 64 64 512 Full No x 1 by 64 64 512 Full No y 1 by 64 64 1024 Full Yes z 1 by 64 64 1024 Full Yes Grand total is 262 elements using 3160 bytes bar(abs(z)) bar(fftshift(abs(z))) %EVEN for kl=1:64 u(kl)=(kl)*pi/64.0; x(kl)=sin(2*(kl)*pi/32.0); x(kl)=x(kl)+1/4*sin(4*(kl)*pi/32.0); x(kl)=x(kl)+1/6*sin(6*(kl)*pi/32.0)+1/8*sin(8*(kl)*pi/32.0)+1/10*sin(10*kl*pi/32.0); end plot(u,x,'-') y=fft(x); plot(y,'co') title('Fourier Coefficients in the Complex Plane'); xlabel('Real Axis'); ylabel('Imaginary Axis'); plot([y(3:4) y(62:63)],'co') plot(u,abs(x),'-',u,abs(fft(fft(x)/64)),'+') plot(u,abs(x),'-',u,abs(fft(fft(fft(fft(x))))/(64*64)),'o') plot(u,abs(x),'-',u,abs(fft(fft(x)/64)),'+',... ,u,abs(fft(fft(fft(fft(x))))/(64*64)),'o') plot([y(3:6) y(60:63)],'co') plot([y(3:4) y(62:63)],'co') %THINK ABOUT THIS bar (abs([y(3:6) y(60:63)])) gg=zeros(58); bar (abs([y(3:6) gg(1,:) y(60:63)])) bar (fftshift(abs([y(3:6) gg(1,:) y(60:63)]) ) ) gg = 0*( 1:58); rot90(gg) ; gg = ( 1:12) ./ ( 1:12) gg = 1:12 ./ 1:12 GIVES ONLY A VECTOR) gg= rot90( ( 1:12) ./ ( 1:12) )