Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

implemest trigonometric function for FFT

Status
Not open for further replies.

cheninbar1

Newbie level 4
Joined
Jan 7, 2012
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,329
hi,

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)?

i'll appriciate your help!
 

For that, I would use a look up table.
 

    V

    Points: 2
    Helpful Answer Positive Rating
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?

thanks

chen inbar
 

but i need something that work for general purpose.
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;
 
know that e^(z)= cos(z)+isin(z)
so tell me how can i implement that please
You have been asking for a FFT implementation, which is not using complex valued trigonometric calculation at runtime.
 

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.
 

hey,

TrickyDicky i found your code very useful. but i didnt understand what the real array represent?
what are the values of real(i)?

thank you
 

real(i) just converts the integer i to a real type.
 

what library should i use? math_real is good?
and can i synthesize it?
 

Ok. So what i need to put instead of the real(i) to make the function creat sin and be able to synthesised?
 

A state of the art FFT implementation doesn't need a synthesizable sin() function, as previously mentioned. It's not clear what you wan to achieve.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top