FPGA implementation of 64QAM baseband signal frequency offset estimation and compensation algorithm based on FFT Fourier transform, including testbench and matlab constellation diagram display

Table of contents

1. Algorithm simulation effect

2. Algorithms involve an overview of theoretical knowledge  

3. Verilog core program 

4. Complete algorithm code file


1. Algorithm simulation effect

This system has developed the Vivado2019.2 platform, and uses matlab2022a to display the constellation diagram of the results:

Use matlab to display the constellation diagram of the frequency offset baseband QPSK signal of the  FPGA and the QPSK baseband signal after frequency offset compensation, and the results are as follows:

 

2. Algorithms involve an overview of theoretical knowledge  

       FFT Fourier transform is an efficient spectrum analysis method, which can convert time-domain signals into frequency-domain signals for frequency offset estimation. FFT Fourier transform is a method of converting a time-domain signal into a frequency-domain signal, which can display the spectral information of the signal. For the baseband signal, the spectrum distribution of the signal can be analyzed through FFT, and an estimate of the frequency offset can be obtained from it. The mathematical principle of FFT Fourier transform is as follows: 

       Assuming that the input time domain signal is x(n), it is converted into a frequency domain signal X(k) by FFT Fourier transform:

        The goal of frequency offset estimation and compensation is to estimate the frequency offset through the received signal, and perform frequency offset compensation on the received signal at the receiving end to make it completely consistent with the frequency of the transmitted signal. The mathematical principle of frequency offset estimation and compensation algorithm based on FFT Fourier transform is as follows (its implementation principle is similar to QPSK):  

        To sum up, the implementation process of QPSK baseband signal frequency offset estimation and compensation algorithm based on FFT Fourier transform mainly includes 64QAM modulation, signal transmission, reception, FFT Fourier transform, frequency offset estimation and frequency offset compensation and other steps.  

3. Verilog core program 

`timescale 1ns / 1ns

module TEST;

	reg clk;
	reg i_clkSYM;
	reg rst;
	reg start;

    wire  [5:0] parallel_data;
    wire [15:0]sin;
    wire [15:0]cos;
	wire signed[19:0]  I_com;
	wire signed[19:0]  Q_com;
    wire signed[15:0]o_Ifir_T;
    wire signed[15:0]o_Qfir_T;
	 

	// DUT
	tops_64QAM_mod  top(
	   .clk(clk),
	   .rst(rst),
	   .start(start),
	   .parallel_data(parallel_data),
	   .sin(sin),
	   .cos(cos),
	   .I_com(I_com),
	   .Q_com(Q_com),
	   .I_comcos(o_Ifir_T),
	   .Q_comsin(o_Qfir_T)
	   );
	   
	   
wire [15:0]o_freq;
wire signed[15:0]o_cos;
wire signed[15:0]o_sin;
wire signed[15:0]o_Ifir;
wire signed[15:0]o_Qfir;
wire o_ends;
wire o_start;
wire o_enable;
wire signed[31:0]absy;
//64相位估计和补偿
tops_64QAM_Fre_est tops_16QAMU(
.i_clk  (clk),
.i_rst  (~rst),
.i_clkSYM(i_clkSYM),
.i_I(o_Ifir_T),
.i_Q(o_Qfir_T), 
.o_ends(o_ends),
.o_start(o_start),
.o_enable(o_enable),
.absy  (absy),
.o_freq(o_freq),
.o_cos  (o_cos),
.o_sin (o_sin),
.o_Ifir (o_Ifir),
.o_Qfir (o_Qfir)
);

	   
 
	initial begin
		clk = 0;
		rst = 0;
		start = 1;
		#10;
		rst = 1;
	end
	
	always #5
	clk <= ~clk;
	


reg writeen;
initial
begin
    writeen = 1'b0;
 
    i_clkSYM=1'b1;

    
    #100
    writeen = 1'b1;
end
 
always #80 i_clkSYM=~i_clkSYM;


initial
begin
 
    #14400000
    
    $stop();
end


//显示发射端带相位旋转的星座图
integer fout1;
integer fout2;
initial begin
 fout1 = $fopen("It.txt","w");
 fout2 = $fopen("Qt.txt","w"); 
end

always @ (posedge clk)
 begin
     if(writeen==1)
     begin
   	 $fwrite(fout1,"%d\n",o_Ifir_T);
	 $fwrite(fout2,"%d\n",o_Qfir_T);
	 end
end

//显示接收端相位估计和补偿之后的星座图

integer fout3;
integer fout4;
initial begin
 fout3 = $fopen("Ir.txt","w");
 fout4 = $fopen("Qr.txt","w"); 
end

always @ (posedge clk)
 begin
     if(writeen==1)
     begin
   	 $fwrite(fout3,"%d\n",o_Ifir);
	 $fwrite(fout4,"%d\n",o_Qfir);
	 end
end
 

endmodule

00_035m

4. Complete algorithm code file

V

Guess you like

Origin blog.csdn.net/hlayumi1234567/article/details/132173116