Commit 5e934bac authored by Tomasz Wlostowski's avatar Tomasz Wlostowski

dsp: fixed sync (LO phase align) input in the I/Q (de)modulators

parent bd3892f8
......@@ -26,6 +26,8 @@ entity gc_iq_demodulator is
clk_i : in std_logic;
rst_i : in std_logic;
sync_p1_i : in std_logic;
-- ADC data input, 2's complement
adc_data_i : in std_logic_vector(g_N-1 downto 0);
......@@ -53,25 +55,28 @@ begin
state <= S_0;
iacc <= (others => '0');
qacc <= (others => '0');
elsif sync_p1_i = '1' then
state <= S_PI2;
iacc <= resize(signed(adc_data_i), g_N + 1);
qacc <= (others => '0');
else
case state is
when S_0 =>
state <= S_PI2;
iacc <= resize( signed( adc_data_i), g_N + 1);
iacc <= resize(signed(adc_data_i), g_N + 1);
qacc <= (others => '0');
when S_PI2 =>
state <= S_PI;
iacc <= (others => '0');
qacc <= resize( signed(adc_data_i), g_N + 1);
qacc <= resize(signed(adc_data_i), g_N + 1);
when S_PI =>
state <= S_3PI2;
iacc <= resize( -signed(adc_data_i), g_N + 1);
iacc <= resize(-signed(adc_data_i), g_N + 1);
qacc <= (others => '0');
when S_3PI2 =>
state <= S_0;
iacc <= (others => '0');
qacc <= resize( -signed(adc_data_i), g_N + 1);
qacc <= resize(-signed(adc_data_i), g_N + 1);
end case;
end if;
end if;
......
......@@ -45,7 +45,7 @@ entity gc_iq_modulator is
port (
clk_i : in std_logic;
en_i : in std_logic;
sync_i : in std_logic;
sync_p1_i : in std_logic;
rst_i : in std_logic;
i_i : in std_logic_vector(g_N-1 downto 0);
......@@ -74,7 +74,7 @@ begin
if rising_edge(clk_i) then
iin <= signed(i_i);
qin <= signed(q_i);
sync <= sync_i;
sync <= sync_p1_i;
end if;
end process;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment