QPSK
QPSK的解调方法为相干解调法
抽样 判决 载波 恢复 位定时 恢复 并串 变换 90°移向 抽样 判决
相干解调原理框图
四、 设计思路
实验中采用选相法进行调制,将一个周期正弦波的128个采样向量按照一定的频率和顺序由FPGA器件输出,输入到D/A转换模块当中,由D/A转换模块输出正弦波。首先将被调制信号进行串并转换,每两位输入二进制信号为一组,由此组二进制信号的组成选择相位,选择原则如下表所示,这样连续输出的信号就构成了调制信号,调制频率由每组信号所对应的正弦
6
QPSK
波形数目以及 串并转换后信号 00 01 10 11 相位/度 0 90 180 270 采样向量 \\\\FPGA的时钟频率所确定。解调所需的载波信号由同样的方法产生。解调时调制信号与载波信号在乘法器模块中进行相乘(首先要进行电平转换,即使调制信号与载波信号的电平符合乘法器模块的输入要求),将乘法器的输出信号通过集成运放放大后再通过有源低通滤波器进行滤波,滤波信号通过A/D转换模块进行采样,采样信号通过FPGA进行判决,在经过并串转换后即可输出得到解调输出信号。
五、 实验程序及其说明
Libraryieee;
use ieee.std_logic_1164.all; useieee.std_logic_unsigned.all; entity modulation is port(clk: in
std_logic;
std_logic; std_logic;
std_logic;
std_logic_vector(7 downto 0); std_logic; std_logic; std_logic;
----采样信号 ----信号da控----载波da控----采样ad控
mout: out y: out x: in x1,x2: in cs,ab,wr:out 制
cs1,ab1,wr1:out 制
oe,adclk:out 制
dsin,dsin1:out
std_logic_vector(7 downto 0)
7
QPSK
);
end modulation;
architecture a of modulation is constantdivide_period: integer:=30; constant divide_period1: integer:=15; signal cnt,cnt1,cnt2: signal sinclk,sinclk1: signal flag,flag1,flag2: signala,b,c,d:
std_logic_vector(6 downto 0);
std_logic; std_logic; std_logic;
signalpcnt:integer range 0 to 127; signal pcnt1:integer range 0 to 127; signal pcnt2:integer range 0 to 127; signal pcnt3:integer range 0 to 255;
signal pcnt4:integer range 0 to 255; signal c0,c1,c2,c3,c4,c5,c6,c7:std_logic; constant divide_period2: integer:=64; signal load: signalxclk: signal cnt3:
std_logic; std_logic;
integer range 0 to 1;
begin
----------------产生m序列驱动信号----------------- process(clk) variablecnt:integer range 0 to 63; begin ifclk'event and clk='1' then
if(cnt<(divide_period2/2)) then xclk<='1'; cnt:=cnt+1;
elsif(cnt<(divide_period2-1)) then xclk<='0'; cnt:=cnt+1; elsecnt:=0;
end if; end if;
end process;
-------------------产生m序列--------------------- process(xclk)
begin
ifxclk'event and xclk='1'then if cnt3<1 then cnt3<=cnt3+1; load<='1'; else if(load='1')then
8
QPSK
c7<='0';c6<='0';c5<='0';
c4<='0';c3<='0';c2<='0'; c1<='0';c0<='1';mout<=c7; else c1<=c0;c2<=c1;c3<=c2;c4<=c3;
c5<=c4;c6<=c5;c7<=c6;mout<=c7; c0<=c7 xor c4 xor c3 xor c2;
end if; end if;
if cnt3=1 then
load<='0'; end if; end if;
end process;
----------------ad以及da的控制信号设置-------------- cs1<='0'; cs<='0'; oe<='0';
ab<='0';
-----分频得到正弦驱动以及信号da、采样ad驱动时钟---------
process(clk) variablecnt:integer range 0 to 29; begin ifclk'event and clk='1' then
if(cnt<(divide_period/2)) then wr<='1';
sinclk<='1'; adclk<='1'; cnt:=cnt+1;
elsif(cnt<(divide_period-1)) then sinclk<='0';
adclk<='0'; wr<='0';
cnt:=cnt+1; elsecnt:=0; end if;
end if;
end process;
-----------------分频得到载波正弦以及载波da驱动时钟----------------
process(clk)
variablecnt:integer range 0 to 14; begin ifclk'event and clk='1' then
9
QPSK
if(cnt<(divide_period1/2)) then wr1<='1'; sinclk1<='1'; cnt:=cnt+1;
elsif(cnt<(divide_period1-1)) then
sinclk1<='0'; wr1<='0';
cnt:=cnt+1; elsecnt:=0; end if;
end if; end process;
-----------------x信号的串并转换----------------- process(sinclk) begin
ifsinclk'event and sinclk='1' then ifpcnt=31 then a<=x; pcnt<=pcnt+1; elsifpcnt=95 then flag<='1';
pcnt<=pcnt+1; b<=x; else pcnt<=pcnt+1;
flag<='0'; end if;
end if;
end process;
----------------调制选择相位--------------------- process(sinclk) begin
ifsinclk'event and sinclk='1' then if flag='1' then
if b='0' and a='0' then cnt<=\elsif b='0' and a='1' then cnt<=\elsif b='1' and a='0' then cnt<=\elsif b='1' and a='1' then
cnt<=\ end if; elsecnt<=cnt+1;
10