 High Pass Filter with FIR (Window Methods) for Image Augmentation

 High Pass Filter Design

Digital signal processing (DSP) is a crucial part of modern electronics and communications systems. To isolate or suppress specific frequency components of a signal, filters are frequently employed in DSP. A high pass filter is a type of filter that allows only high frequency sounds to pass through while weakening low frequency vibrations. One way to create a high pass filter is to combine the Window method with a Finite Impulse Response (FIR) filter. Since FIR filters provide a linear phase response and consistent performance, they are frequently utilized in DSP. In the window methods, the ideal filter response is multiplied by a window function to create a finite length impulse response can then be used to calculate the FIR filter’s coefficients.

High pass filters with FIR are implemented using window methods in a variety of applications, such as audio processing, image processing and biomedical signal processing. They can be applied to signals to preserve their high-frequency components while eliminating low-frequency noise and interference. The window methods are widely utilized in DSP when developing FIR high pass filters. In this approach, the required frequency response is multiplied by a window function to get the filter coefficients. Secondly, the high pass filter will be implemented using the MATALAB software. The task will entail choosing a suitable window function and calculating the filter length in accordance with the specified cutoff frequency. The amplitude response, phase response and frequency response of the filter design will be analyzed and assessed.

The study will also look into how different window functions and filter lengths affect the accuracy of edge detection. In image processing and computer vision, edge detection is a fundamental problem that includes locating the border of areas of an image with various intensities or color values. The potential uses of this technology in fields like robotics, surveillance, and medical imaging are what give it its significance. High-pass filters are necessary for edge detection, an important stage in image processing. The accuracy of object detection and tracking can be increased using high-pass filters by enhancing the quality of edges, which has significant implications in the scientific and technical domains. For different image processing and computer vision applications, high pass filters with FIR design and window methods can be utilized to enhance or extract high-frequency edges from an image.

The objective of this project is to create a high pass filter with FIR using window methods. This project will cover the theory and methodologies of designing digital filters, FIR filters, window methods and high pass filters. A suitable window function will be selected during the design stage, and the MATLAB software will be employed to generate the filter coefficients. The constructed filter will be put to the test with various input signals, and its performance will be evaluated using the filter’s parameters. Students will gain hands-on experience in MATLAB based digital signal processing and filter design through the course of this project. It will also clarify how high pass filters are actually applied in real world settings.

Methodology





Results

Edge detection exists in multiple techniques using different approaches. In this paper, the high-pass filter approach is used with FIR window techniques. The four (4) main adopted windows are the rectangular, hanning, hamming and Blackman’s window.

It is important to note that the input signal of this filter is an image. The image is converted into grayscale to create a lower dimensional matrix (2D) which more computable for edge detection purposes. By converting the image into grayscale format, the color noise is reduced while the most important component only of the image is contained. The frequency spectrum ranges from 0 to 255.

Figure 1: input image

We see that the input image signals create a spectral matrix. The weights of the matrix are mostly below the 50% of 255 which is classified as low frequency shift within that pixel weight range. However, as noticed in figure 1 above, some reflection of light could be found on the side of the car which leads to higher pixel weights. The frequency shift within this pixel weights creates a higher frequency.

To use high-pass filter in this context, it is expected that the lower frequencies shifts will be attenuated creating an edge enhanced effect over the image.

Designing a High-Pass filter using FIR windows

To design a high-pass filter, some specifications is needed to constrain the filter operations. Here, we create a sample calculation that may relay how high-pass filter are designed using FIR windows.

To apply this over the input image shown in figure 1, we first need to do further inspection on the image frequency range.

Figure 2: frequency distribution

To understand how much we need to filter, we can plot the frequency distribution as shown in figure 2 above. The figure expresses the frequency components of the image showing how many pixels is bounded in that frequency.

Considering the variable intensity of images, a sample calculation can be provided and will be applicable for other images.

Table 1: Window Specifications



Figure 3: Magnitude and Phase response of rectangular window (order 10)

The figure above plots the magnitude and phase response of the practical designed filter. It is seen in the figure that the side lobes were down around -20dB with band-pass approximately 300Hz and stop-band at approximately 200Hz.

Figure 4: Magnitude and Phase response of hanning window (order 10)

Expressed in figure 4 above are responses with the side lobes down around -45dB with band-pass extends to approximately 400Hz and stop-band at approximately 100Hz. Here we can observe the growth of side lobe width. This may affect the ripple response of the input signal with respect to the output signal.

Figure 5: Magnitude and Phase response of hamming window (order 10)

Shown in figure 5 above are responses with the side lobes down around -43dB with band-pass extends to approximately 400Hz and stop-band at approximately 100Hz. Here we can observe the growth of side lobe width. This may affect the ripple response of the input signal with respect to the output signal.


Figure 6:Magnitude and Phase response of Blackman’s window (order 10)

The Blackman’s window response shown in figure 6 above, expressed the reduced noise or ripple from the effect of Blackman’s window. However, the window has a wider range of frequency band at the main lobe. It is clearly seen in the above figure that the band-pass extends to approximately 500Hz and stop-band at approximately 0Hz. Here we can observe the growth of side lobe width has been eliminated.

Roll off Rate

Figure 7: comparing roll-off rate at order 20dB

The above figures show the roll-off rate effectively changed when the order is increased. The higher the order, the clear steepness can be seen in the magnitude responses. As compared to the previous design, where the order was set to 10, the roll-off rate was not very steep as could be witness on these ones. Here, rectangular window is still the best as it quickly roll-off to 200Hz or less. The hanning and hamming have similar effects where the roll-off rates were a little bit improved as it drops close to 200 Hz. The Blackman’s window has closed its main lobe width where it roll-off to approximately 100Hz.

Therefore, for this application, the rectangular window may have executed the best in terms of roll-off rate and cut-off frequencies.

Applying Filter to Input Image

To apply the designed filter to the input image, the filter array is convolved with the image array resulting in a filtered image.

Figure 8: figure showing the filter effects over the input image at 10th order

The figure above showed the resultant image after convolving the input image with the filter matrix at 10th order. It can be seen that the rectangular window shows a clear outline on the edges of the images in black lines. The hanning and hamming window have slight differences but they both have white outlining of the enhanced edges. However, the Blackman’s window shows slight of the edges, but can be seen that it still attains some of the color components.

Figure 9: figure showing the filter effects over the input image at 20th order

Figure 9 above shows the edges enhancement by increasing the order to 20. The rectangular window has slight added components while the hanning and the hamming windows have extra details. The most impact goes to the Blackman’s window where the color component from figure 10 disappeared resulting with a detailed edge detector.

Histogram of Frequencies

The histogram of frequencies is replotted to visualize the filtered frequency performed by the high-pass filter in different window effects.

Figure 10: histogram of frequency at 10th order

Shown above are the effect of the filters over the input image frequencies. It is seen that the rectangular, hanning and hamming window attenuates the similar set of frequencies while Blackman’s window still allows some frequencies as around 0.2 and 0.9Hz at normalized range.


Figure 11: histogram of frequencies at 20th order

When increasing the order from 10 to 20, it could be observed that the hanning window turn to pass some set of frequency between 0.1 to 0.2 Hz at normalized range. The Blackman’s window now looses some of its frequency components and can be visually witnessed in figure 8 above.




Comments

Popular posts from this blog

Pothole Detection using Computer Vision (AI Tool)

IoT Tide Gauge System

Semi-autonomous Agricultural Robot