A
aj
Guest
Dear all,
I am implementing 2048 point FFT on virtex pro using VHDL and to start
with i am trying to implement radix 4 FFT.. I am new to vhdl, and i am
stuck at this simple problem
* Please tell me how will i implement twiiddle factors
like it is
(Wbase N)to power nk)= twidle= e to d power -( 2*pi*n*k/N) =
cos(2*pi*nk/N) -j*sin(2*pi*nk/N)
i am just implementing this but i am getting this error
* Error: C:/Xilinx/Project/RAM/radix 4.vhdl(57): Unknown identifier
'sin'.
** Error: C:/Xilinx/Project/RAM/radix 4.vhdl(57): Unknown identifier
'cos'.
** Error: C:/Xilinx/Project/RAM/radix 4.vhdl(57): Bad expression.
** Error: C:/Xilinx/Project/RAM/radix 4.vhdl(57): Bad expression.
** Error: C:/Xilinx/Project/RAM/radix 4.vhdl(57): Bad expression.
** Error: C:/Xilinx/Project/RAM/radix 4.vhdl(57): Bad right hand side
(infix expression) in signal assign
------------------------------------------------------------------------------------------------------
MY Questions------------------>
------------------------------------------------------------------------------------------------------
Q1. I am also bit confused what value will i give to "j". i know " j" =
square root of -1. so what value shall i put in my program...
Q2. please clear my concepts for this twiddle factor, Please tell me
the easiest way to implement twiddle factors. as i am stuck.... as i
have to implement much bigger like 2048 point FFT
My program is giving me error.... if i use cos and sin functionsl...
for default i have given j as a value of -1
-------------------------------------------------------------------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
USE ieee.std_logic_arith.ALL;
USE ieee.std_logic_unsigned.ALL;
use ieee.numeric_std.all;
entity r4 is
generic(
width : integer :=8);
port
( i : in std_logic_vector(width-1 downto 0);
iout : out std_logic_vector(width+1 downto 0);
clock,reset : in std_logic;
ram_read : in bit;
ram_write : in bit
);
end r4;
architecture arch_r4 of r4 is
type ram_data is array (3 downto 0) of std_logic_vector(7 downto 0);
signal tramA : ram_data;
signal tramB : ram_data;
begin
process(clock,reset,ram_write)
variable ram_mem :std_logic_vector( 7 downto 0 );
begin
if ( clock ='1' and clock'event) then
if (ram_write = '1') then
ram_mem := i(7 downto 0);
end if ;
end if ;
end process;
--------------------------------------------------------------
--tx(0) := ((ta(0) + ta(2)) - ( ta(1) + ta(3)));
--tx(1) := ((ta(0) + ta(2)) - ( ta(1) + ta(3))) * (cos( 2*3.14/3) -j *
sin( 2* 3.14/3));
--tx(2) := ((ta(0) - ta(2)) - ( ta(1) - ta(3))) * (cos( 4*3.14/3) -j *
sin( 4* 3.14/3));
--tx(3) := ((ta(0) - ta(2)) + ( ta(1) - ta(3))) * (cos( 6*3.14/3) -j *
sin( 6* 3.14/3));
--------------------------------------------------------------------------
calculaterocess(clock)
variable j : integer:=- 1;
begin
if ( clock ='1' and clock'event) then
if (ram_read ='1') then
tramB(0)<=(tramA(0) + tramA(2)) + ( tramA(1) + tramA(3));
tramB(1)<=(tramA(0) + tramA(2)) - ( tramA(1) + tramA(3))* (cos(
2*3.14/3) -j * sin( 2*3.14 /3));
tramB(2) <=(tramA(0) - tramA(2)) - ( tramA(1) - tramA(3))*(cos(
4*3.14/3) -j * sin( 4* 3.14/3));
tramB(3) <=(tramA(0) - tramA(2)) + ( tramA(1) - tramA(3))*(cos(
6*3.14/3) -j * sin( 6* 3.14/3));
end if;
end if;
end process calculate;
end arch_r4;
I am implementing 2048 point FFT on virtex pro using VHDL and to start
with i am trying to implement radix 4 FFT.. I am new to vhdl, and i am
stuck at this simple problem
* Please tell me how will i implement twiiddle factors
like it is
(Wbase N)to power nk)= twidle= e to d power -( 2*pi*n*k/N) =
cos(2*pi*nk/N) -j*sin(2*pi*nk/N)
i am just implementing this but i am getting this error
* Error: C:/Xilinx/Project/RAM/radix 4.vhdl(57): Unknown identifier
'sin'.
** Error: C:/Xilinx/Project/RAM/radix 4.vhdl(57): Unknown identifier
'cos'.
** Error: C:/Xilinx/Project/RAM/radix 4.vhdl(57): Bad expression.
** Error: C:/Xilinx/Project/RAM/radix 4.vhdl(57): Bad expression.
** Error: C:/Xilinx/Project/RAM/radix 4.vhdl(57): Bad expression.
** Error: C:/Xilinx/Project/RAM/radix 4.vhdl(57): Bad right hand side
(infix expression) in signal assign
------------------------------------------------------------------------------------------------------
MY Questions------------------>
------------------------------------------------------------------------------------------------------
Q1. I am also bit confused what value will i give to "j". i know " j" =
square root of -1. so what value shall i put in my program...
Q2. please clear my concepts for this twiddle factor, Please tell me
the easiest way to implement twiddle factors. as i am stuck.... as i
have to implement much bigger like 2048 point FFT
My program is giving me error.... if i use cos and sin functionsl...
for default i have given j as a value of -1
-------------------------------------------------------------------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
USE ieee.std_logic_arith.ALL;
USE ieee.std_logic_unsigned.ALL;
use ieee.numeric_std.all;
entity r4 is
generic(
width : integer :=8);
port
( i : in std_logic_vector(width-1 downto 0);
iout : out std_logic_vector(width+1 downto 0);
clock,reset : in std_logic;
ram_read : in bit;
ram_write : in bit
);
end r4;
architecture arch_r4 of r4 is
type ram_data is array (3 downto 0) of std_logic_vector(7 downto 0);
signal tramA : ram_data;
signal tramB : ram_data;
begin
process(clock,reset,ram_write)
variable ram_mem :std_logic_vector( 7 downto 0 );
begin
if ( clock ='1' and clock'event) then
if (ram_write = '1') then
ram_mem := i(7 downto 0);
end if ;
end if ;
end process;
--------------------------------------------------------------
--tx(0) := ((ta(0) + ta(2)) - ( ta(1) + ta(3)));
--tx(1) := ((ta(0) + ta(2)) - ( ta(1) + ta(3))) * (cos( 2*3.14/3) -j *
sin( 2* 3.14/3));
--tx(2) := ((ta(0) - ta(2)) - ( ta(1) - ta(3))) * (cos( 4*3.14/3) -j *
sin( 4* 3.14/3));
--tx(3) := ((ta(0) - ta(2)) + ( ta(1) - ta(3))) * (cos( 6*3.14/3) -j *
sin( 6* 3.14/3));
--------------------------------------------------------------------------
calculaterocess(clock)
variable j : integer:=- 1;
begin
if ( clock ='1' and clock'event) then
if (ram_read ='1') then
tramB(0)<=(tramA(0) + tramA(2)) + ( tramA(1) + tramA(3));
tramB(1)<=(tramA(0) + tramA(2)) - ( tramA(1) + tramA(3))* (cos(
2*3.14/3) -j * sin( 2*3.14 /3));
tramB(2) <=(tramA(0) - tramA(2)) - ( tramA(1) - tramA(3))*(cos(
4*3.14/3) -j * sin( 4* 3.14/3));
tramB(3) <=(tramA(0) - tramA(2)) + ( tramA(1) - tramA(3))*(cos(
6*3.14/3) -j * sin( 6* 3.14/3));
end if;
end if;
end process calculate;
end arch_r4;