

Problem finding the DFT of the sequence as the length of sequence increases
Respected Sir / Madam I am developing code for DFT of sequence. I am posting the code for you. The problem I am facing is the length of the sequence it is request statement is appearing again. Yous help will be priceless. Yours sincerely T.V.Chandra shekar
clc;\\nclear;\\n//delete(gcf());\\n\\nx = input('Enter The Sequence');\\nN=length(x);\\nsubplot(3,1,1);\\nplot2d3("gnn",x);set(gca(),"grid",[1 1]);\\nxgrid(color("green"));\\nxtitle('Input Sequence','n Time Axis','Amplitude');\\ns = zeros(1,length(N));\\n\\n//DFT Code\\nfor k=0:N-1 \\n s(k+1) = 0;\\n for n = 0:N-1\\n s(k+1) = s(k+1) + (x(n+1).*exp((-%i*2*%pi*k*n)/N));\\n end\\nend\\ndisp('Discrete Fourier Transform is : ');\\ndisp(s);\\nsubplot(3,1,2);\\nplot2d3("gnn",abs(s));xgrid(color("green"));\\nxtitle('Spectrum','f Frequency Axis','Magnitude');\\n\\nN1=length(s);\\n\\nfor n=0:N1-1\\n y(n+1)=0\\n for k=0:N1-1\\n y(n+1)=y(n+1)+(s(k+1).*exp((%i*2*%pi*k*n)/N1));\\n end\\nend\\ndisp('Inverse discrete fourier transform');\\ndisp(abs(y/N1));\\nsubplot(3,1,3);\\nplot2d3("gnn",abs(y/N1));xgrid(color("green"));\\nxtitle('Inverse DFT','n Time Axis','Amplitude');\\n//\\n//
Scilab


Hello,
Your code works perfectly for me, I have tested in the scilab.
Please explain your problem, if you are still facing any errors.
Login to add comment