提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
文章目录
为什么要进行调制?FSK调制原理二、调制的过程1.M序列发生器2.载波的实现3.调制信号4.wave仿真图5.波形查看技巧 总结为什么要进行调制?
FSK(Frequency-shift keying)- 频移键控是利用载波的du频率变化来传递数字信息。它是利用基带数字信号离散取值特点去键控载波频率以传递信息的一种数字调制技术。FSK(Frequency-shift keying)是信息传输中使用得较早的一种调制方式,它的主要优点是: 实现起来较容易,抗噪声与抗衰减的性能较好。在中低速数据传输中得到了广泛的应用。 最常见的是用两个频率承载二进制1和0的双频FSK系统。 技术上的FSK有两个分类,非相干和相干的FSK 。 在非相干的FSK ,瞬时频率之间的转移是两个分立的价值观命名为马克和空间频率,分别为。 在另一方面,在相干频移键控或二进制的FSK ,是没有间断期在输出信号。 在数字化时代,电脑通信在数据线路(电话线、网络电缆、光纤或者无线媒介)上进行传输,就是用FSK调制信号进行的,即把二进制数据转换成FSK信号传输,反过来又将接收到的FSK信号解调成二进制数据,并将其转换为用高,低电平所表示的二进制语言,这是计算机能够直接识别的语言
FSK调制(2FSK为二进zhi数字频率调制),用载波的频率来传送数字信息,即用所传送的数字信息控制载波dao的频率。
2FSK信号便是符号“0”对应于载频 f1,而符号“1”对应于载频 f2(与 f1 不同的另一载频)的已调波形,而且 f1 与 f2 之间的改变是瞬间的。
传“0”信号时,发送频率为 f1 的载波; 传“1”信号时,发送频率为 f2的载波。可见,FSK 是用不同频率的载波来传递数字消息的。
FSK调制原理
示例:pandas 是基于NumPy 的一种工具,该工具是为了解决数据分析任务而创建的。
二、调制的过程
1.M序列发生器
M序列的方式又很多种,这是比较简单的一种,代码如下(示例):
module m_seq1023(input rst_n,input clk ,input clk_en,output m_seq_out);reg [9:0] data_temp;wire bit_temp;assign bit_temp = data_temp[7]^data_temp[0];//移位寄存器always @(posedge clk or negedge rst_n)if (!rst_n)data_temp <= 10'd5; else if(clk_en)data_temp <= {bit_temp,data_temp[9:1]};assign m_seq_out = data_temp[9];endmodule
2.载波的实现
载波可以直接使用IPcore,在这里投个懒直接使用查表法,构造SIN函数波形。
0:begin carryWave0<=0;carryWave1<=0; carryWave2<=0;carryWave3<=0;end1:begin carryWave0<=12;carryWave1<=25; carryWave2<=49;carryWave3<=90;end2:begin carryWave0<=25;carryWave1<=49; carryWave2<=90;carryWave3<=127;end3:begin carryWave0<=37;carryWave1<=71; carryWave2<=117;carryWave3<=90;end4:begin carryWave0<=49;carryWave1<=90; carryWave2<=127;carryWave3<=0;end5:begin carryWave0<=60;carryWave1<=106; carryWave2<=117;carryWave3<=-90;end6:begin carryWave0<=71;carryWave1<=117; carryWave2<=90;carryWave3<=-127;end7:begin carryWave0<=81;carryWave1<=125; carryWave2<=49;carryWave3<=-90;end8:begin carryWave0<=90;carryWave1<=127; carryWave2<=0;carryWave3<=0;end9:begin carryWave0<=98;carryWave1<=125; carryWave2<=-49;carryWave3<=90;end10:begin carryWave0<=106;carryWave1<=117; carryWave2<=-90;carryWave3<=127;end11:begin carryWave0<=112;carryWave1<=106; carryWave2<=-117;carryWave3<=90;end12:begin carryWave0<=117;carryWave1<=90; carryWave2<=-127;carryWave3<=0;end13:begin carryWave0<=122;carryWave1<=71; carryWave2<=-117;carryWave3<=-90;end14:begin carryWave0<=125;carryWave1<=49; carryWave2<=-90;carryWave3<=-127;end15:begin carryWave0<=126;carryWave1<=25; carryWave2<=-49;carryWave3<=-90;end16:begin carryWave0<=127;carryWave1<=0; carryWave2<=0;carryWave3<=0;end17:begin carryWave0<=126;carryWave1<=-25; carryWave2<=49;carryWave3<=90;end18:begin carryWave0<=125;carryWave1<=-49; carryWave2<=90;carryWave3<=127;end19:begin carryWave0<=122;carryWave1<=-71; carryWave2<=117;carryWave3<=90;end20:begin carryWave0<=117;carryWave1<=-90; carryWave2<=127;carryWave3<=0;end21:begin carryWave0<=112;carryWave1<=-106; carryWave2<=117;carryWave3<=-90;end22:begin carryWave0<=106;carryWave1<=-117; carryWave2<=90;carryWave3<=-127;end23:begin carryWave0<=98;carryWave1<=-125; carryWave2<=49;carryWave3<=-90;end24:begin carryWave0<=90;carryWave1<=-127; carryWave2<=0;carryWave3<=0;end25:begin carryWave0<=81;carryWave1<=-125; carryWave2<=-49;carryWave3<=90;end26:begin carryWave0<=71;carryWave1<=-117; carryWave2<=-90;carryWave3<=127;end27:begin carryWave0<=60;carryWave1<=-106; carryWave2<=-117;carryWave3<=90;end28:begin carryWave0<=49;carryWave1<=-90; carryWave2<=-127;carryWave3<=0;end29:begin carryWave0<=37;carryWave1<=-71; carryWave2<=-117;carryWave3<=-90;end30:begin carryWave0<=25;carryWave1<=-49; carryWave2<=-90;carryWave3<=-127;end31:begin carryWave0<=12;carryWave1<=-25; carryWave2<=-49;carryWave3<=-90;end32:begin carryWave0<=0;carryWave1<=0; carryWave2<=0;carryWave3<=0;end33:begin carryWave0<=-12;carryWave1<=25; carryWave2<=49;carryWave3<=90;end34:begin carryWave0<=-25;carryWave1<=49; carryWave2<=90;carryWave3<=127;end35:begin carryWave0<=-37;carryWave1<=71; carryWave2<=117;carryWave3<=90;end36:begin carryWave0<=-49;carryWave1<=90; carryWave2<=127;carryWave3<=0;end37:begin carryWave0<=-60;carryWave1<=106; carryWave2<=117;carryWave3<=-90;end38:begin carryWave0<=-71;carryWave1<=117; carryWave2<=90;carryWave3<=-127;end39:begin carryWave0<=-81;carryWave1<=125; carryWave2<=49;carryWave3<=-90;end40:begin carryWave0<=-90;carryWave1<=127; carryWave2<=0;carryWave3<=0;end41:begin carryWave0<=-98;carryWave1<=125; carryWave2<=-49;carryWave3<=90;end42:begin carryWave0<=-106;carryWave1<=117; carryWave2<=-90;carryWave3<=127;end43:begin carryWave0<=-112;carryWave1<=106; carryWave2<=-117;carryWave3<=90;end44:begin carryWave0<=-117;carryWave1<=90; carryWave2<=-127;carryWave3<=0;end45:begin carryWave0<=-122;carryWave1<=71; carryWave2<=-117;carryWave3<=-90;end46:begin carryWave0<=-125;carryWave1<=49; carryWave2<=-90;carryWave3<=-127;end47:begin carryWave0<=-126;carryWave1<=25; carryWave2<=-49;carryWave3<=-90;end48:begin carryWave0<=-127;carryWave1<=0; carryWave2<=0;carryWave3<=0;end49:begin carryWave0<=-126;carryWave1<=-25; carryWave2<=49;carryWave3<=90;end50:begin carryWave0<=-125;carryWave1<=-49; carryWave2<=90;carryWave3<=127;end51:begin carryWave0<=-122;carryWave1<=-71; carryWave2<=117;carryWave3<=90;end52:begin carryWave0<=-117;carryWave1<=-90; carryWave2<=127;carryWave3<=0;end53:begin carryWave0<=-112;carryWave1<=-106; carryWave2<=117;carryWave3<=-90;end54:begin carryWave0<=-106;carryWave1<=-117; carryWave2<=90;carryWave3<=-127;end55:begin carryWave0<=-98;carryWave1<=-125; carryWave2<=49;carryWave3<=-90;end56:begin carryWave0<=-90;carryWave1<=-127; carryWave2<=0;carryWave3<=0;end57:begin carryWave0<=-81;carryWave1<=-125; carryWave2<=-49;carryWave3<=90;end58:begin carryWave0<=-71;carryWave1<=-117; carryWave2<=-90;carryWave3<=127;end59:begin carryWave0<=-60;carryWave1<=-106; carryWave2<=-117;carryWave3<=90;end60:begin carryWave0<=-49;carryWave1<=-90; carryWave2<=-127;carryWave3<=0;end61:begin carryWave0<=-37;carryWave1<=-71; carryWave2<=-117;carryWave3<=-90;end62:begin carryWave0<=-25;carryWave1<=-49; carryWave2<=-90;carryWave3<=-127;end63:begin carryWave0<=-12;carryWave1<=-25; carryWave2<=-49;carryWave3<=-90;end
3.调制信号
//调制部分always @(posedge stClk)beginif(codeSource)beginsigOut=carryWave1;endelsebeginsigOut=carryWave0;endend
4.wave仿真图
代码如下(示例):
5.波形查看技巧
选中希望以模拟波形显示的信号,右击选择format—>Analog(automatic),此外,如果发现波形不对的话,可以选择Radix,下选有符号数试一试
总结
2FSK调制的核心思想就是0和1两种不同的状态对应两种不同的频率,到信号接收端的时候通过判断信号的频率从而确定数字信号原本的状态。因此通过一个if的判断语句即可完成。
下载可致
/download/qq_36026488/84989419