initialize ROM using a generic value

Joined
Jul 20, 2010
Messages
1
Reaction score
0
I need to model a ROM of twiddle factors for an FFT implementation. The FFT is supposed to be parameterized for input data sample size (ie number of samples to have the FFT performed on). This means that the twiddle ROM will be of a varying size.

The perl code below generates the real and imaginary twiddle factors. Basically, how can I initialize ROM locations using the type of expressions below? Is this even possible or do I need to specify the ROM using an external file (I have seen this process in a few locations including Xilinx's XST manual).

Thanks!

$PI = 3.14159_26535_89793_23846_26433_83279_50288_41971_69399_37510;
$PI2 = $PI * 2.;
$K1 = $PI2 / $FFT_SIZE;

for ($i = 0; $i <= ($FFT_SIZE-1); $i++) {

$twiddle_rl[$i] = cos($K1 * $i);
$twiddle_im[$i] = sin($K1 * $i);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top