Printing X(w) and not X(k) from a written DFT algorithm

6 views (last 30 days)
So I am trying to write a DFT algorithm not using Matlab pre-defined FFT functions. I believe I have gotten achieved it using matrix multiplications, however when I graph the result I am only able to get for X(k) and I want to graph it for values of X(omega).
N = 12; Wk = exp(-j*2*pi/N); W = zeros(N,N); X = zeros(N,1);
for n = 0:1:N-1 if n <= 2 X(n+1, 1) = cos(n*pi); else X(n+1, 1) = 0; end for k = 0:1:N-1 W(n+1,k+1) = Wk^(n*k); end end
Fw = (W*X); figure
plot(abs(Fw)); xlabel ('Bin numbers(k)')

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!