Question: Write a matlab function called compute_dft.m to compute the DFT of a given discrete signal, f[n]. The discrete signal should be an input, and the
Write a matlab function called compute_dft.m to compute the DFT of a given discrete signal, f[n]. The discrete signal should be an input, and the DFT, F[k] should be an output. Please compute DFT without using the fft() command or any for loops.
I currently have code that looks like this (but this uses for loops, which I don't want):
function[fk] = compute_dft(xn,n) %computing for xn input
L = length(xn); %go through whole thing
%checking the length
if(n x1= [xn zeros(1,n-L)]; %zeros in the input sequence for n=0:1:n-1; for k=0:1:n-1; p= exp(2*pi*-j*n*k/N); x2(k+1,n+1) =p; end end fk = x1*x2;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
