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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!