% % Written by: % -- % John L. Weatherwax 2005-08-04 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % % Epage % %----- close all; clc; clear; X = [ 1, 2, 1; 0, 1, 1; 2, 1, 2 ]; % Check that the expression conj(dftmtx(N))/sqrt(N) generates the book's matrix W: % %N = 40; N = size(X,1); W_N = exp( -i * 2 * pi / N ); pwr = ( 0:(N-1) )'; w_n_exponents = pwr * (pwr'); WHhat_no_N = W_N .^ w_n_exponents; % this is W^H (without the factor of 1/sqrt(N)) What_no_N = conj( WHhat_no_N ); % this is W without the factor of 1/sqrt(N) WH_no_N = dftmtx(N); % this is W^H (without the factor of 1/sqrt(N)) W_no_N = conj(dftmtx(N)); % this is W without the factor of 1/sqrt(N) % check that the two matrices are the same: norm( What_no_N - W_no_N ) % put in the denominators: WH = WH_no_N/sqrt(N); W = W_no_N/sqrt(N); % now compute the DFT (using matrix multiplications): % Y = WH * X * WH; Y