i need to implement FFT in VHDL. i dont knoe how to implement expression e^(-i*2*pi*k/N).
can i implement it like this or i should trasform this expression to trigonomeric funtion: cos(-i*2*pi*k/N)- i*sin(-i*2*pi*k/N)?
thank you.
but i need something that work for general purpose.
thank you for the link to your site, but unfortunately i couldnt find anything helpful.
can you send me the vhdl version of the 8 point FFT please?
What do you mean with general purpose in this regard? A FFT block in VHDL can be expected to have a fixed size, and thus, the required table can be calculated at compile time. It can be performed in VHDL code using ieee.math_real library.
i cant use in the library real and real types because its not sinthesable.
i know that e^(z)= cos(z)+isin(z)
so tell me how can i implement that please.
you can use real types to set up constants and generics. So you cant use them in run time code for synthesis, but you can set up constants with them.
eg.
Code:
type sin_table_t is array(0 to 1023) sfixed(0 downto -15);
function set_sin_table return sin_table_t is
variable ret_table : sin_table_t;
begin
for i in 0 to 1023 loop
ret_table(i) := to_sfixed( (real(i) * MATH_PI) / 1024.0, 0, -15);
end loop;
return ret_table;
end function set_sin_table;
--This look up table has 1024 points of sin 0 - PI
constant SIN_TABLE : sin_table_t := set_sin_table;
If you're doing this as an academic exercise, ask your instructor/tutor/professor for help.
If you're doing this for a real project, just use the FFT core provided by your tool vendor. Xilinx provide a perfectly good FFT core; I'm sure all the others do, too.