METHOD FOR EQUIVALENT HIGH SAMPLING RATE FIR FILTERING BASED ON FPGA

20190080035 ยท 2019-03-14

Assignee

Inventors

Cpc classification

International classification

Abstract

The present invention provides a method for equivalent high sampling rate FIR filtering based on FPGA, first, the coefficients h(k) of FIR filter are found by using MATLAB, multiplied by an integer and then rounded for the purpose that the rounded coefficients h(k) can be directly used into a FPGA, then the ADC's output of high data rate f.sub.s is lowered by dividing the ADC's output x(n) into M parallel data streams x.sub.i(n) of low data rate, and the ML samples in one clock circle is obtained by delaying the M parallel data streams x.sub.i(n) simultaneously by 1, 2, . . . , L periods of the synchronous clock, at last, the samples y.sub.i(n) of FIR filtering output is calculated according to the samples selected from the ML samples, and the filtered data y(n) of data rate f.sub.s is obtained by putting the samples y.sub.i(n) together in ascending order of i. Thus, the continuous FIR filtering of an ADC's output sampled with high sampling rate is realized, while the data rates before and after the FIR filtering are unchanged.

Claims

1. A method for equivalent high sampling rate FIR filtering based on FPGA, comprising: (1). using MATLAB to find the coefficients h(k) of FIR filter according to the requirements of an actual application, where the length L of the FIR filter satisfies that L mod M=0, and letting L=L/M; (2). multiplying the coefficients h(k) by an integer, and then rounding the multiplied coefficients h(k) for the purpose that the rounded coefficients h(k) can be directly used into a FPGA; (3). lowering the data rate f.sub.s of an ADC's output x(n) by dividing the ADC's output x(n) into M parallel data streams x.sub.i(n) (i=0, 1, . . . , M1) of f.sub.s/M data rate; (4). delaying the M parallel data streams x.sub.i(n) simultaneously by 1, 2, . . . , L periods of the synchronous clock to obtain ML samples in one clock circle; (5). selecting L+M1 samples from the obtained ML samples in a clock circle, and calculating the samples y.sub.i(n) (i=0, 1, . . . , M1) of FIR filtering output as follows: y i ( n ) = .Math. .Math. k = 0 L - 1 .Math. .Math. h ( k ) .Math. x ( nM + i - k ) = .Math. h ( 0 ) .Math. x ( nM + i ) + h ( 1 ) .Math. x ( nM + i - 1 ) + .Math. + h ( L - 1 ) .Math. x ( nM + i - ( L - 1 ) ) = .Math. h ( 0 ) .Math. x ( nM + i ) + h ( 1 ) .Math. x ( nM + i - 1 ) + .Math. + h ( L - 1 ) .Math. x ( ( n - L ) M + i + 1 ) ; (6). putting the samples y.sub.i(n) together in ascending order of i to obtain the filtered data y(n) of data rate f.sub.s; (7). repeating the step (5), step (6) in later circles, continuously obtaining the filtered data y(n) of data rate f.sub.s.

2. The method for equivalent high sampling rate FIR filtering based on FPGA of claim 1, wherein the integer is selected as the integral power of 2.

Description

BRIEF DESCRIPTION OF THE DRAWING

[0025] The above and other objectives, features and advantages of the present invention will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:

[0026] FIG. 1 is a diagram of a FIR filtering structure based on the combination of multi-channel parallel data in prior art;

[0027] FIG. 2 is a diagram of a polyphase filtering structure in prior art;

[0028] FIG. 3 is a diagram of a FIR filtering structure in accordance with the present invention;

[0029] FIG. 4 is a flow diagram of an equivalent high sampling rate FIR filtering based on FPGA in accordance with the present invention;

[0030] FIG. 5 is a diagram of locations of the L+M1 continuous samples of an ADC's output x(n) in L+1 continuous clock circles of CLK in accordance with the present invention;

[0031] FIG. 6 is a diagram of locations of the L+M1 continuous samples of an ADC's output x(n) in one circle of CLK in accordance with the present invention;

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

[0032] Hereinafter, preferred embodiments of the present invention will be described with reference to the accompanying drawings. It should be noted that the similar modules are designated by similar reference numerals although they are illustrated in different drawings. Also, in the following description, a detailed description of known functions and configurations incorporated herein will be omitted when it may obscure the subject matter of the present invention.

Embodiment

[0033] FIG. 3 is a diagram of a FIR filtering structure in accordance with the present invention.

[0034] In one embodiment, the data rate of an ADC's output x(n) is f.sub.s, i.e. the ADC's output x(n) is obtained at sampling rate f.sub.s. The impulse response, namely the coefficients of FIR filter are h(k), k=1, 2, . . . , L1. The filtered data of the ADC's output x(n) is y(n). The data rate of the filtered data y(n) is same as that of the ADC's output x(n), also is f.sub.s. The filtered data y(n) is:

[00002] y ( n ) = .Math. k = - .Math. .Math. h ( k ) .Math. x ( n - k ) ( 1 )

[0035] Where the clock frequency of filtering operation is f.sub.s. While the filtering operation is realized in a FPGA, the ADC's output x(n) cannot directly be received by the FPGA because the clock frequency f.sub.s of filtering operation is higher than the highest system clock frequency of the FPGA. Thus, the data rate f.sub.s of the ADC's output x(n) is needed to be lowered by using a high-speed receiver to divide it into M parallel data streams x.sub.i(n). So the equation (1) is performed in parallel, and multi channels (M) filtered data y.sub.i(n), i=1, 2, . . . M1, are outputted. The multi channels filtered data are the polyphase decompositions of the filtered data y(n), and the data rate of the filtered data y(n) is same as that of the ADC's output x(n). Therefore, the essence of the present invention is: by using the multi channels of parallel filtering to realize that the data rate before and after the FIR filtering is unchanged.

[0036] FIG. 4 is a flow diagram of an equivalent high sampling rate FIR filtering based on FPGA in accordance with the present invention.

[0037] In one embodiment, As shown in FIG. 3 and FIG. 4, a method for equivalent high sampling rate FIR filtering based on FPGA comprises the following steps:

[0038] Step S1: Using MATLAB to find the coefficients h(k) of FIR filter according to the requirements of an actual application, where the length L of the FIR filter satisfies that L mod M=0, and letting L=L/M.

[0039] Step S2: Multiplying the coefficients h(k) by an integer, and then rounding the multiplied coefficients h(k) for the purpose that the rounded coefficients h(k) can be directly used into a FPGA.

[0040] In the embodiment, the integer is selected as the integral power of 2.

[0041] Step S3: Lowering the data rate f.sub.s of an ADC's output x(n) by dividing the ADC's output x(n) into M parallel data streams x.sub.i(n) (i=0, 1, . . . , M1) of f.sub.s/M data rate.

[0042] In the embodiment, the high-speed receiver divides the ADC's output x(n) into M parallel data streams x.sub.i(n) of f.sub.s/M data rate, the filtered data y(n) are decomposed into y.sub.i(n) (i=0, 1, . . . , M1), They can be expressed in equation as:

[00003] { x i ( n ) = x ( nM + i ) y i ( n ) = y ( nM + i ) ( 2 )

[0043] Step S4: Delaying the M parallel data streams x.sub.i(n) simultaneously by 1, 2, . . . , L periods of the synchronous clock to obtain ML samples in one clock circle.

[0044] When the length of the FIR filter is L, and L mod M=0, the samples y.sub.i(n) (i=0, 1, . . . , M1) of FIR filtering output is:

[00004] y i ( n ) = .Math. y ( nM + i ) = .Math. .Math. k = 0 L - 1 .Math. .Math. h ( k ) .Math. x ( nM + i - k ) ( 3 )

[0045] Further:

[00005] .Math. ( 4 ) y i ( n ) = .Math. .Math. k = 0 L - 1 .Math. .Math. h ( k ) .Math. x ( nM + i - k ) = .Math. h ( 0 ) .Math. x ( nM + i ) + h ( 1 ) .Math. x ( nM + i - 1 ) + .Math. + h ( L - 1 ) .Math. x ( nM + i - ( L - 1 ) ) = .Math. h ( 0 ) .Math. x ( nM + i ) + h ( 1 ) .Math. x ( nM + i - 1 ) + .Math. + h ( L - 1 ) .Math. x ( ( n - L ) M + i + 1 )

[0046] From equation (4), to obtain one sample y.sub.i(n), i+1+(L1)M+Mi1=LM=L continuous samples of x(n) are needed to implement the multiple-accumulating in equation (4). And if M continuous samples of filtered data y(n), which respectively respond to the samples y.sub.i(n) (i=0, 1, . . . , M1) are needed to be obtained simultaneously in one clock circle, the L+M1 continuous samples from x((nL)M+1) to x((nM+M1) are needed.

[0047] The locations of the L+M1 continuous samples are shown in FIG. 5, where CLK is the synchronous clock of frequency f.sub.s/M. From the FIG. 5, we will find that the L+M1 continuous samples are distributed in L+1 continuous clock circles of CLK.

[0048] As shown in FIG. 6, to obtain the L+M1 continuous samples in one clock circle, the M parallel data streams x.sub.i(n) are delayed simultaneously by 1, 2, . . . , L periods of the synchronous clock, where x.sub.i.sup.j(n) is the sample obtained by delaying x.sub.i(n) j periods of CLK and can be express as follows:

[00006] x i j ( n ) = .Math. x i ( n - j ) = .Math. x ( ( n - j ) .Math. M + i ) ( 5 )

[0049] where j=1, 2, . . . , L.

[0050] After delaying the M parallel data streams x.sub.i(n), the ML samples in one clock circle (for example, the leftmost column) are obtained in one clock circle. The L+M1 continuous samples from x((nL)M+1) to x((nM+M1) are in the ML samples.

[0051] In the embodiment, datain_i denotes x.sub.i(n) and datain_i_j is obtained by delaying datain_i j periods of CLK. The related Verilog codes in FPGA are as follows:

TABLE-US-00001 always @ (posedge CLK) begin datain_0_1<=datain _0; datain_0_2<=datain_0_1; ... datain_0_j<=datain_0_(j-1); ... datain_0_L<=datain_0_(L-1);//i=0 -------------------------------------------------------------------- datain_1_1<=datain _1; datain_1_2<=datain_1_1; ... datain_1_j<=datain_1_(j-1); ... datain_1_L'<=datain_1_(L-1);// i=1 -------------------------------------------------------------------- ...................... -------------------------------------------------------------------- datain_(M-1)_1<=datain _(M-1); datain_(M-1)_2<=datain_(M-1)_1; ... datain_(M-1)_j<=datain_(M-1)_(j-1); ... datain_(M-1)_L<=datain_(M-1)_(L-1);//i=M-1 end

[0052] After executing the above codes, the ML samples in one clock circle are obtained.

[0053] Step S5: Selecting L+M1 samples from the obtained ML samples in a clock circle, and calculating the samples y.sub.i(n) (i=0, 1, . . . , M1) of FIR filtering output as follows:

[00007] .Math. ( 6 ) y i ( n ) = .Math. .Math. k = 0 L - 1 .Math. .Math. h ( k ) .Math. x ( nM + i - k ) = .Math. h ( 0 ) .Math. x ( nM + i ) + h ( 1 ) .Math. x ( nM + i - 1 ) + .Math. + h ( L - 1 ) .Math. x ( nM + i - ( L - 1 ) ) = .Math. h ( 0 ) .Math. x ( nM + i ) + h ( 1 ) .Math. x ( nM + i - 1 ) + .Math. + h ( L - 1 ) .Math. x ( ( n - L ) M + i + 1 )

[0054] In the embodiment, dataout_i denotes y.sub.i(n), and coeff_n denotes the coefficients h(k) (k=0, 1, . . . , L1). The related Verilog codes are as follows:

TABLE-US-00002 always @(posedge CLK) begin data_out_0 <= coeff_0*datain_0 + coeff_1*datain_(M-1)_1 + ... + coeff_(L-1)*datain_1_L; // i=0 data_out_1 <= coeff_0*datain_1 + coeff_1*datain_0 + ... + coeff_(L-1)*datain_2_L;// i=1 ...................... data_out_(M-1)<=coeff_0*datain_(M-1)+coeff_1*datain_(M-2)+...+ coeff_(L-1)*datain_0_(L'-1);//i=M-1 end

[0055] After executing the above codes, the samples y.sub.i(n) (i=0, 1, . . . , M1) of FIR filtering output are obtained.

[0056] Step S6: Putting the samples y.sub.i(n) together in ascending order of i to obtain a filtered data y(n) of data rate f.sub.s.

[0057] Step S7: Repeating the step S5, step S6 in later circles, continuously obtaining the filtered data y(n) of data rate f.sub.s.

[0058] Thus, the continuous FIR filtering of an ADC's output sampled with high sampling rate is realized, while the data rates before and after the FIR filtering are unchanged.

[0059] In present invention, according to equation (4), the calculation of each sample y.sub.i(n) needs all L filter coefficients, but different samples of the ADC's output x(n) are involved. For the calculation of one sample y.sub.i(n), L multipliers are needed. Thus, for the calculation of all samples y.sub.i(n) (i=0, 1, . . . , M1), ML multipliers are needed. In actual application, the coefficients of FIR filter are symmetric, i.e. h(k)=h(L1k), k=0, 1, . . . , L1, only half of the ML multipliers are needed, saving half of multiplier sources.

[0060] While illustrative embodiments of the invention have been described above, it is, of course, understand that various modifications will be apparent to those of ordinary skill in the art. Such modifications are within the spirit and scope of the invention, which is limited and defined only by the appended claims.