MATLAB: DFT dft How do i calculate DFT in matlab? I do not want FFT. Best Answer Hi Lisa, you had a couple problems with your code:N= 4; x=1:4;for k=0:3 for n = 0:3;y(n+1) = x(n+1).*exp(-(1j*2*pi*k*n)/N); end xdft(k+1)= sum(y);endcompare tofft(x) Related SolutionsMATLAB: Non-Constant Frequency & FFT See my answer to your newsgroup posting.Hope this helps.GregP.S. I don't think MATLAB wants you to post the same question to the Newsgroup and Answers. MATLAB: FFT and sin wave If the signal is real-valued:t = 0:.001:1-0.001;Fs = 1e3;x = cos(2*pi*100*t)+randn(size(t));xdft = fft(x);xdft = xdft(1:length(x)/2+1);freq = 0:Fs/length(x):Fs/2;plot(freq,abs(xdft));xlabel('Hz'); Related QuestionSignal processing, fft, adding two cosine waves
Best Answer