tag:blogger.com,1999:blog-410288222235817148.post5124344225862773814..comments2021-04-29T00:49:43.973-07:00Comments on Microwave Engineering Project: IQ Correct entity and architecture files - updateMichellehttp://www.blogger.com/profile/12516156190562527937noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-410288222235817148.post-64182850311773942952011-01-16T22:11:22.883-08:002011-01-16T22:11:22.883-08:00architecture IQGainPhaseCorrection_beh of IQGainPh...architecture IQGainPhaseCorrection_beh of IQGainPhaseCorrection is<br /><br /> --signal declarations <br /><br /> --phase error calculation<br /> signal reg_1:std_logic_vector(7 downto 0);<br /> signal reg_1_sv:std_logic_vector(7 downto 0);<br /><br /> --gain error calculation<br /> signal reg_2:std_logic_vector(7 downto 0);<br /> signal reg_2_sv:std_logic_vector(7 downto 0);<br /> <br /> --Phase Offset Corrected<br /> signal y2:std_logic_vector(7 downto 0);<br /><br /> --Gain and Phase Offset Corrected<br /> signal y3:std_logic_vector(7 downto 0);<br /> <br /><br /> <br /> <br />begin <br /><br /> correction : process <br /> <br /> --local variables<br /><br /> --SNR scaling?<br /> variable mu_1:real:=0.0002;<br /> variable mu_2:real:=0.0001;<br /> <br /> begin<br /> wait until clk'event and clk = '1';<br /> <br /> y2 <= y1 - reg_1 * x1;<br /> reg_1_sv <= reg_1;<br /> reg_1 <= reg_1 + mu_1 * x1 * y2;<br /> <br /> y3 <= y2 * reg_2;<br /> reg_2_sv <= reg_2;<br /> reg_2 <= reg_2 + mu_2*(abs((x1)*(x1)) - abs((y3)*(y3)));<br /> <br /> end process;<br /><br />end IQGainPhaseCorrection_beh;Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-410288222235817148.post-53173865653964158562011-01-16T22:10:55.841-08:002011-01-16T22:10:55.841-08:00library ieee;
use ieee.std_logic_1164.all;
use IE...library ieee;<br />use ieee.std_logic_1164.all; <br />use IEEE.std_logic_arith.all;<br /><br /><br />entity IQGainPhaseCorrection is<br /><br />generic(input_width:natural:=11;<br /> output_width:natural:=7);<br /><br />port(<br /> clk:in std_logic;<br /> x1 :in std_logic_vector(input_width downto 0);<br /> y1 :in std_logic_vector(input_width downto 0);<br /> gain_error :out std_logic_vector(output_width downto 0);<br /> phase_error :out std_logic_vector(output_width downto 0)<br />);<br /><br />end IQGainPhaseCorrection;Anonymousnoreply@blogger.com