Sign in

username or email:

password:



Not a member?
Forgot your password?

Search code



Search tips


See Also

Embedded SystemsFPGA

DSP Code Sharing > Discrete Fourier Tranform Matrix generation

Discrete Fourier Tranform Matrix generation

Language: Scilab

Processor: Not Relevant

Submitted by Senthilkumar R on Feb 6 2011

Licensed under a Creative Commons Attribution 3.0 Unported License

Discrete Fourier Tranform Matrix generation


 

This function used to generate Discrete Fourier Transform kernel for 2D operations

 
function [D] = dft_mtx(n)
f = 2*%pi/n;                 // Angular increment.
w = (0:f:2*%pi-f/2).' *%i;   //Column.
//disp(w)
x = 0:n-1;                  // Row.
D = exp(-w*x);              // Exponent of outer product.
for i = 1:n
    for j = 1:n
        if((abs(real(D(i,j)))<0.0001)&(abs(imag(D(i,j)))<0.0001))
            D(i,j)=0;
        elseif(abs(real(D(i,j)))<0.0001)
            D(i,j)= 0+%i*imag(D(i,j));
        elseif(abs(imag(D(i,j)))<0.0001)
            D(i,j)= real(D(i,j))+0;
        end
    end
end
endfunction
 
Rate this code snippet:
0
Rating: 0 | Votes: 0
 
   
 
posted by Senthilkumar R



Comments


No comments yet for this code


Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )