Beruflich Dokumente
Kultur Dokumente
FOURIER TRANSFORM is a mathematical operation to convert the function or signal from time domain to frequency domain, There are two type of FOURIER TRANSFORM one for analogue signal and the other called discrete FOURIER TRANSFORM (DFT) for digital or discrete signal, The DFT has many application, like in a filtering process to remove the noise from voice signal for example The DFT is defined by the formula
Example: if we have this signal x=[2 2 -2 -2] and we want to convert it from time domain to frequency domain:
Fast Fourier transform (FFT) is a fast algorithms efficiently to compute the discrete Fourier transform (DFT). The most important part in FFT is the butter fly:
Where WN is
We can build 4 points FFT by using four butter fly As the following
As the same idea we can build FFT for 8 point By using four 4 points FFT
The summary
RTL of design
yr1: out std_logic_vector (5 downto 0); yi1: out std_logic_vector (5 downto 0)); end butter; architecture Behavioral of butter is signal s:std_logic_vector (5 downto 0); begin s<=wi&wi&wi&wi&wi&wi; yr0<=xr0+( xr1 and(not s))+(Xi1 and s); yi0<=xi0+(((not(xr1))+1)and s)+( xi1 and(not s)); yr1<=xr0+(((not(xr1))+1)and(not s))+(((not(xi1))+1)and s); yi1<=(xr1 and s)+xi0+( xi1 and(not s)); end Behavioral;
if(rst='1')then count:=0; elsIF (ck'EVENT AND ck='1') THEN CASE count IS WHEN 0 => y0 <= "00"&xxx; WHEN 1 => y1 <= "00"&xxx; WHEN 2 => y2 <= "00"&xxx; WHEN 3 => y3 <= "00"&xxx; WHEN OTHERS => NULL; END CASE; if(count<4)then count:=count+1; end if; end if; end process; end Behavioral;
begin process(ck,rst) variable count:integer RANGE 0 TO 8:=0; begin if(rst='1')then count:=0; yy<="00000000"; elsIF (ck'EVENT AND ck='1' )THEN CASE count IS WHEN 0 => yy <= "01"&x0; WHEN 1 => yy <= "10"&x1; WHEN 2 => yy <= "01"&x2; WHEN 3 => yy <= "10"&x3; WHEN 4 => yy <= "01"&x4; WHEN 5 => yy <= "10"&x5; WHEN 6 => yy <= "01"&x6; WHEN 7 => yy <= "10"&x7; WHEN OTHERS => NULL; END CASE; if(count<8) then count:=count+1; end if;end if;end process;end Behavioral
component butter is Port ( Xr0: in STD_LOGIC_VECTOR (5 downto 0); Xi0: in STD_LOGIC_VECTOR (5 downto 0); Xr1: in STD_LOGIC_VECTOR (5 downto 0); Xi1: in STD_LOGIC_VECTOR (5 downto 0);
wi: in STD_LOGIC; yr0: out STD_LOGIC_VECTOR (5 downto 0); yi0: out STD_LOGIC_VECTOR (5 downto 0); yr1: out STD_LOGIC_VECTOR (5 downto 0); yi1: out STD_LOGIC_VECTOR (5 downto 0)); end component butter; --------------------------------------------------------------------------------------------------------------------------------component par2ser is Port ( ck,rst,sn:in std_logic; x0 : in STD_LOGIC_VECTOR (5 downto 0); x1 : in STD_LOGIC_VECTOR (5 downto 0); x2 : in STD_LOGIC_VECTOR (5 downto 0); x3 : in STD_LOGIC_VECTOR (5 downto 0); x4 : in STD_LOGIC_VECTOR (5 downto 0); x5 : in STD_LOGIC_VECTOR (5 downto 0); x6 : in STD_LOGIC_VECTOR (5 downto 0); x7 : in STD_LOGIC_VECTOR (5 downto 0); yy : out STD_LOGIC_VECTOR (7 downto 0)); end component par2ser;
signal x0, x1, x2, x3,fe0,fe1,fo0,fo1,fei0,fei1,foi0,foi1: STD_LOGIC_VECTOR (5 downto 0); signal yyr0,yyi0, yyr1,yyi1,yyr2,yyi2, yyr3,yyi3: STD_LOGIC_VECTOR (5 downto 0); begin ------------------------------------------------------------------------------------------------------U0: ser2par port map (clk,rsst,x,x0,x1,x2,x3); ------------------------------------------------------------------------------------------------------U1: butter port map (x0,"000000",x2 ,"000000",'0',fe0,fei0,fe1,fei1); U2: butter port map (x1,"000000",x3 ,"000000",'0',fo0,foi0,fo1,foi1); U3: butter port map (fe0,fei0 ,fo0 ,foi0 ,'0',yyr0,yyi0,yyr2,yyi2); U4: butter port map (fe1,fei1 ,fo1 ,foi1 ,'1',yyr1,yyi1,yyr3,yyi3); ------------------------------------------------------------------------------------------------------U6: par2ser port map (clk2,rsst2,yyr0,yyi0, yyr1,yyi1,yyr2,yyi2, yr3,yyi3,y); ------------------------------------------------------------------------------------------------------end Behavioral;