Design and implementation of VLS architecture of low-pass filter

Publisher:泉地水无痕Latest update time:2015-03-14 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Chapter One Introduction

Images sometimes suffer from interference, which is called noise. Due to the different nature of noise, the methods for removing noise are also different. Here we assume that the noise is an interference bright spot. This noise is high-frequency noise, so a low-pass filter is used to blur the noise, thereby achieving the effect of removing the noise.

1.1 Research background and motivation

The original meaning of noise is a general term for external interference. What is image noise? For example, poor image reception due to poor condition of the TV antenna can be divided into two categories. One is that the image itself is distorted, skewed or blurred. The second is that various forms of interference spots, stripes, etc. appear on the image. The latter kind of interference is called image noise.

Due to the different nature of noise, the methods for removing noise are also different. So, how to remove noise from a noisy image? This is the subject of this study. Our goal is to remove interfering noise and obtain a clear image.

Therefore, after we can enlarge and observe the image with noise interference, we can know that there is a large concentration difference between the concentration of noise and the concentration of surrounding pixels. It is this rapidly changing concentration difference that makes people feel dazzled. The method of removing noise by using this property of noise is generally called smoothing. However, there are also sharply changing density differences at the boundary of the image. How to properly separate the boundary from the noise and only remove the noise part is something that needs to be paid attention to.

1.2 Introduction to digital imaging types

There are four basic image types. Here is a brief introduction.

1. Binary digital image (binary) Each pixel is either black or white. Since there are only two possible values ​​for a pixel, only 1 bit is required per pixel, making this image very efficient to store.

2. Grayscale image (grayscale) Each pixel is gray, but with different shades. Generally speaking, the range is from 0 (black) to 255 (white). It can be seen that each pixel requires 8 bits to represent.

3. Full color or RGB image (true color) Each pixel has its own color, which is made up of different proportions of red, green, and blue. And the range of each primary color shade is 0-255. Because each pixel requires 24 bits, this image is also called a 24-bit color image.

4. Indexed images Most images are concentrated in a certain part. In order to facilitate storage and processing, a corresponding colormap or color palette is created. The value of each pixel only represents the corresponding color spectrum. The index of the color.

Chapter 2 421 Filter and Algorithm

We can correct the image by performing specific functions on the pixels. The same method can be used for the surrounding parts (neighborhood). The main concept is to apply a mask to a specified image. In this way, a new image will be generated as shown in Figure 2.1, and the pixel values ​​of the image are calculated based on the pixel values ​​under the mask. The combination of mask and function is called filter.

The operation of the filter can be roughly divided into three steps:

1. Place the mask on the specified pixel.

2. Multiply all elements of the filter with the corresponding pixels in the neighborhood.

3. Add the results of the above multiplications and calculate the average.

This operation is repeated for all pixels in the image.

 

 

 

2.1 High-pass filter and low-pass filter

An important concept in image processing is frequency. Simply put, the frequency of an image is a measure of how pixel values ​​change with distance. The high-frequency part (high-frequency) refers to the large changes in pixel values ​​within a short distance, such as the edge part of the image or the noise part. In contrast, low-frequency parts are parts of the image where the pixel values ​​do not change much, such as the background.

Therefore, the so-called high-pass filter (high-pass filter) is a filter that maintains the high-frequency part and reduces or eliminates the low-frequency part; while a low-pass filter (low-pass filter) maintains the low-frequency part. Partial, filter that reduces or eliminates high frequencies.

2.2 421 low-pass filter algorithm

For example, if there is a 421 low-pass filter function and the specified pixel E and its neighboring pixel values ​​as shown in Figure 2.2 and Figure 2.3,

 

 

Then the result of its operation on the specified pixel is

E'= (A + 2B + C + 2D + 4E + 2F + G + 2H + I ) / 16

Taking the above example, the 421 average filter is a low-pass filter. The effect of this filter will blur the edges or reduce high-frequency noise, so here we can use it to reduce the noise interference of bright spots. And since the function of the 421 low-pass filter is a linear calculation and belongs to a linear filter, it can be disassembled into a representation as shown in Figure 2.4.

 

2.3 Processing of image boundary extension

The issue of image boundaries has not been discussed before in this section. As shown in Figure 2.5, if the specified pixel is on the boundary, the masker may exceed the image boundary. In the real world, the image we want to process must be of limited size, so boundary problems will arise. Therefore, how to deal with the issue of boundary extension is particularly important.

 

There are many types of methods for solving boundary extensions, each with its own advantages and disadvantages. For example, the zero-padding method is to calculate all parts that exceed the boundary as zero. This method is the simplest way to implement it. However, because the gap that may be caused is too large, it is not suitable for us to use here. Another method is periodic symmetry extension, which uses a copy of the neighborhood of a specified pixel to do the calculation. The advantage of this is that the extended part of the boundary will have similar values ​​to adjacent pixels, creating a visual continuity effect. So here we use this method to deal with the problem of boundary extension. As shown in Figure 2.6.

 

Chapter 3 Hardware Functions and Specifications

In the previous chapter, we briefly explained the algorithm of the 421 low-pass filter. This chapter introduces it and the functions and specifications of each internal part. Its architecture is shown in Figure 3.1.

 

Table 3.1 LPF input and output pins

 

Enter pin name

Function Description

Size (bits)

CLK

clock cycle.

1

RSt

Reset, 0 means reset; 1 means no action.

1

DIN

Receive input data.

twenty four

DINEn

Controls the enablement of input data; 0 represents enablement.

1

HS

1 when the data is before the beginning or after the end of each line of the picture; otherwise 0.

1

VS

1 when the data is before the beginning or after the end of the picture; otherwise 0.

1

Output pin name

Function Description

Size (bits)

DOUT

Send output data.

twenty four

DOUTEn

Controls the enablement of output data; 0 represents enablement.

1

 

 

Table 3.1 describes the input and output pins. We use positive edge triggering for the clock cycle here. The reset is a low level reset, the high level does not work. Because our image type uses YUV, and YUV is 8 bits each, the input and output data are 24 bits. However, it should be noted that we only perform image processing on Y, so in order to save memory space, the U of even-numbered rows is retained but V is discarded, the U of odd-numbered rows is discarded but V is retained, and the UVs between the two rows are shared. In addition, the input and output enable pins are low level enable.

 

3.1 Structure at all levels

This low-pass filter can be roughly divided into three architectures, as shown in Figure 3.3. These include Boundary, Memory, Processor, etc. They are described one by one as follows.

 

3.1.1 Boundary processor

In order to deal with the special situation when the image extends at the boundary, we have designed a part specifically used to deal with boundary problems, as shown in Figure 3.4.

 

The specifications of the boundary processor are listed in Table 3.2. DIN_1, DIN_2 and DIN_3 only contain YU or YV and are therefore 16 bits. DOUT_1, DOUT_2, DOUT_3, DOUT_4 and DOUT_5 only contain Y or U or V, so they are 8 bits. C_EVEN is to control the reading and writing operations of the memory, so C_EVEN will be connected to the input pin of the memory.

Table 3.2

 

Enter pin name

Function Description

Size (bits)

CLK

clock cycle.

1

RSt

Reset, 0 means reset; 1 means no action.

1

HS

1 when the data is before the beginning or after the end of each line of the picture; otherwise 0.

1

VS

When the data is before the beginning of the picture (or after the end), it is 1; otherwise, it is 0.

1

DINEn

Controls the enablement of input data; 0 represents enablement.

1

DIN_1

Even column data read from SRAM.

16

DIN_2

Odd column data read from SRAM.

16

DIN_3

Data read from the scan column.

16

Output pin name

Function Description

Size (bits)

DOUTEn

Controls the enablement of output data; 0 represents enablement.

1

DOUT_1

Only data containing Y and sent to Processer.

8

DOUT_2

Only data containing Y and sent to Processer.

8

DOUT_3

Only data containing Y and sent to Processer.

8

DOUT_4

Contains only information about U.

8

DOUT_5

Contains only V's information.

8

C_EVEN

0 means the scanned columns are even columns; 1 means odd columns.

1 3.1.2 Memory

We store the data of even columns and odd columns in different memories. First use Memory Generate to call out the SRAM of the single port, and then combine it with the control read and write circuit to form the memory as shown in Figure 3.5. The memory architecture of the even columns and odd columns is the same, only the control read and write circuit is slightly different.

 

Table 3.3

 

Enter pin name

Function Description

Size (bits)

CLK

clock cycle.

1

RSt

Reset, 0 means reset; 1 means no action.

1

DINEn

Controls the enablement of input data; 0 represents enablement.

1

DIN

Data written to memory.

32

C_EVEN

0 means the scanned columns are even columns; 1 means odd columns.

1

Output pin name

Function Description

Size (bits)

DOUT

Data read from memory.

32

 

 

It was mentioned at the beginning of this chapter that in order to save memory space, when storing data, the original data is not stored directly, but only YU or YV is taken, and two rows of data are stored at a time, so the input and output data are 32 bits.

 

3.1.3 Computing processor

The main function of the calculation processor is to handle the calculation of the weighted function for Y. DIN_1 and DIN_3 have a weight of 1, while DIN_2 has a weight of 2.

 

The computing processor specifications are sorted out in Table 3.4.

Table 3.4

 

Enter pin name

Function Description

Size (bits)

CLK

clock cycle.

1

RSt

Reset, 0 means reset; 1 means no action.

1

DIN_1

Contains only Y and has a weight of 1.

8

DIN_2

Contains only Y and has a weight of 2.

8

DIN_3

Contains only Y and has a weight of 1.

8

Output pin name

Function Description

Size (bits)

DOUT

The output is the calculated Y.

8

 

 

Chapter 4 Hardware Design

This chapter begins with designing the various internal parts of the filter, which are described below.

4.1 Boundary processor

Before designing the boundary processor, we must first consider several cases of periodic symmetry extension. It includes up and down periodic symmetrical extension, left and right periodic symmetrical extension, and the last one is when the two situations happen at the same time.

First consider the up and down periodic symmetrical extension, which occurs when the specified pixel is any pixel in the first column or the last column. The left and right periodic symmetrical extension occurs when the specified pixel is any pixel in the first row or the last row. Both situations will occur at the same time when specifying pixels as the four endpoints of the image.

4.1.1 Upper and lower periodic symmetrical extension

To solve the problem of periodic symmetry extension up and down, just copy DIN_1 to DIN_3 or copy DIN_3 to DIN_1 when specifying the pixels as the first and last columns. At the upper boundary, you must wait until the second column is scanned before copying; at the lower boundary, the data read from the memory is copied directly.

 

4.1.2 Left and right periodic symmetrical extension

It is similar to the problem of periodic symmetry extension up and down, so the solution is also similar, just paste the read data to the left or right side. On the left border, you must wait until the second row of pixels is scanned before you can copy it as an extension; on the right border, if you want to get the pixels that have been scanned as an extension, you need to use a temporary register.

 

We can find that the boundary processor will not have the first output until the second column and second row are scanned (DIN_1, DIN_2 and DIN_3 are output at the same time). Therefore, the architecture as shown in Figure 4.3 can be designed.

 

4.1.3 Two situations occur simultaneously

When both situations occur simultaneously, the extension method is shown in Figure 2.6.

4.2 Memory

Judging from the storage method in Figure 3.6, although one pixel value is scanned at a time, using the temporary register and synthesis, two pixel values ​​can be stored at one time, and DEEven can be taken as YU; Dodd can be YV before input. . When outputting, the temporary register can also be used and decomposed, as shown in Figure 4.4.

 

In terms of controlling reading and writing, it should be noted that when an even-numbered column is scanned, the read-write pin of the memory storing the odd-numbered column will always remain in the read state; and when an odd-numbered column is scanned, the read-write pin of the memory storing the even-numbered column will be The read and write pins will always remain in the read state.

4.3 Computing processor

Perform the disassembly operation according to Figure 2.4, as shown in Figure 4.5(a)(b)(c). It can be seen that only two 1x3 filters and some temporary registers are needed to complete the disassembly operation of Figure 2.4.

 

 

 

Therefore, the computing processor is the simplest in design, most of which are composed of combinational circuits. As shown in Figure 4.6.

 

The temporary registers R1 and R2 are used to temporarily store the results calculated by ALU_1, as shown in Figure 4.7. The function of ALU_1 and ALU_2 is to calculate the weighted function. The output is DIN_1 + 2*DIN_2 + DIN_3. However, attention should be paid to the setting of the bit size of the ALU_1 output and ALU_2 input to avoid overflow. Finally, the output of ALU_2 is shifted to the right by 4 bits (divided by 16 in function calculation), and DOUT is the Y value after the weighted calculation.

 

Chapter 5 Design and Verification Process

In this chapter, we will briefly introduce the LPF design process, and then use a set of test data to verify whether the simulation results are correct.

5.1 Design process

As shown in Figure 5.1, the function of the architecture is first considered, and then the hardware description language Verilog HDL is used to implement the design of the function. After the compiler confirms that the syntax is correct, the results are simulated. If there is a problem, go back and look for errors; if there is no problem, complete the entire design process. 5.2 Simulation and verification

After completing the RTL, it is necessary to simulate and verify whether the results are correct. First, convert the .ppm file into a .dat file, because this is a file that testbench in Verilog HDL can read. In addition to using Verilog HDL to simulate the 421 low-pass filter, we also use C language to simulate the 421 low-pass filter, and save the output results of the two into .dat files for comparison. If the result is correct, convert it back to .ppm file.

 

5.3 Wave pattern diagram

When the simulation is complete, use Verdi to observe the wave pattern.

5.3.1 Low-pass filter

Figure 5.3(a)(b) illustrates that when the read data is before the beginning or after the end of the picture, VS will be 1; otherwise it will be 0. When the read data is before or after the beginning or end of each line of the image, HS will be 1; otherwise it will be 0.

 

 

5.3.2 Boundary processor

As mentioned before, the boundary processor needs to use the temporary register and shift it. As shown in Figure 5.4, R1, R4, R7, and R10 delay DIN_1 by one, two, three, and four clock cycles respectively; R2, R5, R8, and R11 delay DIN_2 by one, two, three, and four clock cycles respectively. Four clock cycles; R3, R6, R9, and R12 are delayed by one, two, three, and four clock cycles for DIN_3 respectively.

 

Figure 5.4 Boundary processor

 

Figure 5.4 Boundary processor

5.3.3 Memory

In terms of controlling the reading and writing of the memory, it should be noted that when an even-numbered column is scanned, the read-write pin of the memory storing the odd-numbered column will always remain in the read state; and when an odd-numbered column is scanned, the memory of the even-numbered column is stored. The read and write pins of the body will always remain in the read state. Figure 5.5(a) is when scanning to odd-numbered columns, while Figure 5.5(b) is when scanning to even-numbered columns. The difference in WEn can be noticed.

 

Figure 5.5(a) Memory for storing even columns

 

Figure 5.5(a) Memory for storing even columns

 

Figure 5.5(b) Memory for storing even columns

 

Figure 5.5(b) Memory for storing even columns

5.3.4 Calculation processor

It can be seen that using the displacement of the temporary register, only two 1x3 filters are needed to achieve the originally required function weighting calculation.

 

Figure 5.6 Computing processor

 

Figure 5.6 Computing processor


Reference address:Design and implementation of VLS architecture of low-pass filter

Previous article:Application of RFID technology in baby anti-theft system (Intetag)
Next article:Design of rechargeable touch screen remote control module

Latest Power Management Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号