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);
}
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);
}