当前位置:网站首页>[QPSK if] Verilog design of QPSK IF signal generation module based on FPGA

[QPSK if] Verilog design of QPSK IF signal generation module based on FPGA

2022-06-10 23:09:00 FPGA and MATLAB

1. Software version

matlab2013b+quartusii

2. Theoretical knowledge of this algorithm

QPSK The signal can be expressed as :

QPSK The composition block diagram of the signal is shown in Figure 1 Shown .

  below , We will design a based on this structure QPSK Modulation signal transmission module .

3. Part of the source code

`timescale 1ns / 1ps
module tops(
            i_clk,
            i_rst,
				o_signal,
				o_I,
				o_Q,
				o_I_filter,
				o_Q_filter,
				o_I_cos,
				o_Q_sin,
				o_R
            );

input              i_clk;
input              i_rst;
output             o_signal;
output signed[1:0] o_I;
output signed[1:0] o_Q;
output signed[15:0]o_I_filter;
output signed[15:0]o_Q_filter;
output signed[15:0]o_I_cos;
output signed[15:0]o_Q_sin;
output signed[15:0]o_R;

wire clk4m;
wire clk8m;
DCM DCM_u(
          .i_clk     (i_clk),
			 .i_rst     (i_rst),
			 .o_clk_8m1 (clk4m),
			 .o_clk_8m2 (clk8m)
          );
			  
signal signal_u(
              .i_clk (clk4m),
              .i_rst (i_rst),
				  .o_dout(o_signal)
              );

s2p s2p_u(
           .i_clk    (clk4m),
			  .i_clk2   (i_clk),
			  .i_rst    (i_rst),
			  .i_signal (o_signal),
			  .o_I      (o_I),
			  .o_Q      (o_Q)
          );

filter filter_u1(
                .i_clk (i_clk),
				    .i_rst (i_rst),
				    .i_din (o_I),
				    .o_dout(o_I_filter)
               );			 
			 
filter filter_u2(
                .i_clk (i_clk),
				    .i_rst (i_rst),
				    .i_din (o_Q),
				    .o_dout(o_Q_filter)
               );				 

					
					
wire signed[15:0]fsin;
wire signed[15:0]fcos;					 
					 
NCO_ip NCO_ip_u(
	         .phi_inc_i (16'd16384),
	         .clk       (i_clk),
	         .reset_n   (~i_rst),
	         .clken     (1'b1),
	         .fsin_o    (fsin),
	         .fcos_o    (fcos),
	         .out_valid ()
	         );

 
reg signed[31:0]r_I_cos;
reg signed[31:0]r_Q_sin; 				 
		
always @(posedge i_clk or posedge i_rst)
begin
     if(i_rst)
	  begin
	  r_I_cos <= 32'd0;
	  r_Q_sin <= 32'd0;
	  end
else begin
	  r_I_cos <= fcos*o_I_filter;
	  r_Q_sin <= fsin*o_Q_filter;
     end
end
assign o_I_cos = r_I_cos[29:14];
assign o_Q_sin = r_Q_sin[29:14];
		
assign o_R = o_I_cos + o_Q_sin;						
					
endmodule 

4. Simulation effect

Through the design , system-wide RTL The structure diagram is shown below :

The simulation results are as follows :

A01-110

原网站

版权声明
本文为[FPGA and MATLAB]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206102148365609.html