第一范文网 - 专业文章范例文档资料分享平台

FPGA课程设计 二进制相位键控(PSK)调制器与解调器设计(DOC)

来源:用户分享 时间:2025/9/16 11:59:32 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

武汉理工大学《FPGA原理及应用》课程设计报告

附录

附录1 2CPSK调制器的程序代码

library ieee;

use ieee.std_logic_arith.all; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity PL_CPSK is

port(clk :in std_logic; --系统时钟

start :in std_logic; --开始调制信号 x :in std_logic; --基带信号

y :out std_logic); --已调制输出信号 end PL_CPSK;

architecture behav of PL_CPSK is

signal q:std_logic_vector(1 downto 0); --2位计数器 signal f1,f2:std_logic; --载波信号 begin

process(clk) --此进程主要是产生两重载波信号f1,f2 begin

if clk'event and clk='1' then if start='0' then q<=\

elsif q<=\ elsif q=\ else f1<='0';f2<='1';q<=q+1; end if; end if;

end process;

process(clk,x) --此进程完成对基带信号x的调制 begin

if clk'event and clk='1' then --上升沿触发 if q(0)='1' then

if x='1' then y<=f1; --基带信号x为‘1’时,输出信号y为f1 else y<=f2; --基带信号x为‘0’时,输出信号y为f2 end if; end if; end if;

end process; end behav;

20

武汉理工大学《FPGA原理及应用》课程设计报告

附录2 2CPSK解调器的程序代码

library ieee;

use ieee.std_logic_arith.all; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity PL_CPSK2 is

port(clk :in std_logic; --系统时钟 start :in std_logic; --同步信号 x :in std_logic; y :out std_logic); end PL_CPSK2;

architecture behav of PL_CPSK2 is signal q:integer range 0 to 3; begin

process(clk) begin

if clk'event and clk='1' then if start='0' then q<=0;

elsif q=0 then q<=q+1; if x='1' then y<='1'; else y<='0'; end if;

elsif q=3 then q<=0; else q<=q+1; end if; end if;

end process; end behav;

--调制信号 --基带信号 --此进程完成对CPSK调制信号的解调 --在q=0时,根据输入信号x的电平来进行判决 21

武汉理工大学《FPGA原理及应用》课程设计报告

附录3 2DPSK调制器绝对码转换为相对码的程序代码

library ieee;

use ieee.std_logic_arith.all; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity PL_DPSK is

port(clk :in std_logic; --系统时钟

start :in std_logic; --开始转换信号 x :in std_logic; --绝对码输入信号 y :out std_logic); --相对码输出信号 end PL_DPSK;

architecture behav of PL_DPSK is

signal q:integer range 0 to 3; --分频器

signal xx:std_logic; --中间寄存信号 begin

process(clk,x) --此进程完成绝对码到相对码的转换 begin

if clk'event and clk='1' then

if start='0' then q<=0; xx<='0';

elsif q=0 then q<=1; xx<=xx xor x;y<=xx xor x; --输入信号与前一个输出信号进行异或 elsif q=3 then q<=0; else q<=q+1; end if; end if;

end process; end behav;

22

武汉理工大学《FPGA原理及应用》课程设计报告

附录4 2DPSK解调器相对码转换为绝对码的程序代码

library ieee;

use ieee.std_logic_arith.all; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity PL_DPSK2 is

port(clk :in std_logic; --系统时钟

start :in std_logic; --开始转换信号 x :in std_logic; --相对码输入信号 y :out std_logic); --绝对码输出信号 end PL_DPSK2;

architecture behav of PL_DPSK2 is

signal q:integer range 0 to 3; --分频

signal xx:std_logic; --寄存相对码 begin

process(clk,x) --此进程完成相对码到绝对码的转换 begin

if clk'event and clk='1' then if start='0' then q<=0; elsif q=0 then q<=1;

elsif q=3 then q<=0; y<=xx xor x; xx<=x; --输入信号x与前一输入信号xx进行异或 else q<=q+1; end if; end if;

end process; end behav;

23

FPGA课程设计 二进制相位键控(PSK)调制器与解调器设计(DOC).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c55nxv1wmvg8iiwn479cv9uewu2s0h401dzi_7.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top