博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

频率偏差角度估计---Verilog

Posted on 2020-06-29 21:55  沉默改良者  阅读(700)  评论(1编辑  收藏  举报

频率偏差角度估计---Verilog

 1 module CFO_Estimating(
 2 
 3     //Module clock
 4     input        wire                Clk,
 5     //the reset signal
 6     input        wire                Rst_n,
 7     //the enable signal of the input datas
 8     input        wire                DataInEnable,
 9     //the input datas:signed 1QN format
10     input        wire     [7:0]      DataInRe,
11     input        wire     [7:0]      DataInIm,
12     output       wire                TempPhaseOutEnable,
13     output       wire     [15:0]     TempPhaseOut,
14     //the enable signal of the output phase
15     output       wire                PhaseOutEnable,
16     //the output phase
17     //signed 2QN format
18     /*输出角度值 参照2QN格式******//////
19     /*补码格式              ******//////
20     /*16位位宽 1位符号位 2位整数位 13位小数位*******///////
21     output       wire     [15:0]     PhaseOut);
22 
23 /*******************用于粗频偏估计数据延迟相关模块******************/
24 
25 //the enable signal of the correlation results
26 wire DelayCorrelationEnable;
27 //the correlation results
28 wire [15:0] DelayCorrelationRe;
29 wire [15:0] DelayCorrelationIm;
30 //Delay Correlation Module
31 DelayCorrelation DelayCorrelation (
32     .Clk(Clk), 
33     .Rst_n(Rst_n), 
34     .DataInEnable(DataInEnable), 
35     .DataInRe(DataInRe), 
36     .DataInIm(DataInIm), 
37     .DelayCorrelationEnable(DelayCorrelationEnable), 
38     .DelayCorrelationRe(DelayCorrelationRe), 
39     .DelayCorrelationIm(DelayCorrelationIm)
40     );
41 
42 /**************用长度为16的窗口累加相关运算结果*******************/
43 
44 //the enable signal of accumulation results
45 wire SlideWindowOutEnable;
46 //the accumulation results
47 wire [15:0] SlideWindowOutRe;
48 wire [15:0] SlideWindowOutIm;
49 
50 //Correlation Accumulation Module
51 Correlation_Accumulation Correlation_Accumulation (
52     .Clk(Clk), 
53     .Rst_n(Rst_n), 
54     .DataInEnable(DelayCorrelationEnable), 
55     .DataInRe(DelayCorrelationRe), 
56     .DataInIm(DelayCorrelationIm), 
57     .SlideWindowOutEnable(SlideWindowOutEnable), 
58     .SlideWindowOutRe(SlideWindowOutRe), 
59     .SlideWindowOutIm(SlideWindowOutIm)
60     );
61 
62 /*********************偏差角度估算************************/
63 //Phase Estimation Module
64 Estimation_phase Estimation_phase (
65     .Clk(Clk), 
66     .Rst_n(Rst_n), 
67     .DataInEnable(SlideWindowOutEnable), 
68     .DataInRe(SlideWindowOutRe), 
69     .DataInIm(SlideWindowOutIm),
70     .TempPhaseOutEnable(TempPhaseOutEnable), 
71     .TempPhaseOut(TempPhaseOut), 
72     .PhaseOutEnable(PhaseOutEnable), 
73     .PhaseOut(PhaseOut)
74     );
75 
76 endmodule