Does anyone have a algorithm for DFT without FFT function in matlab?
and second question is how can I make zero padding in this algorithm?
Does anyone have a algorithm for DFT without FFT function in matlab?
and second question is how can I make zero padding in this algorithm?
As mentioned by the applesoup, you should try dftmtx(). However, if you want to write a code for generating the DFT matrix, here it is,
funtion dftmatrix = myDFTmtx(N)
dftmatrix = [];
for k = 0:N-1
row = [];
for n = 0:N-1
row = [row exp(-j*2*pi*k*n/N)];
end
dftmatrix = [dftmatrix; row];
end
end
The matrix returned by this function when multiplied with the time domain sequence or column vector, will return its DFT coefficients.
dftmtx()? – applesoup Dec 13 '18 at 13:28dftmtx()to obtain the DFT of your signal. The result is of course identical to the FFT. An example is shown here. – applesoup Dec 13 '18 at 14:00