MidtermReport

6
1 Abstract— A group of assassins has attacked three diplomats of our neighboring allies. Our central intelligence agency has intercepted two images that could provide vital information to stopping them. These images were filled with noise and were rendered useless. However, a low pass FIR filter of length five was created in order to decode the images. The two images were cleaned up by the filter and were able to be read by our central intelligence agency. Index Terms— lowpass filter, filter, FIR, cascade, Magnitude Spectrum I. INTRODUCTION Within the past ten days, three assassinations of high profile government officials have occurred. Fortunately, our secret service intercepted some images of suspicious activities. Unfortunately, the group of assassins knew ahead of time about our satellite. When the satellite took the pictures, absolutely nothing is visible. The picture was encrypted by the assassins to make it seem like noise ruined the satellite’s images. Figures 1 and 2 are the intercepted, distorted images. Figure 1: Intercepted Signal 1 Figure 2: Intercepted Signal 2 A filter is a special system designed to use remove or modify some components from 1 ECE 09.351.02 Digital Signal Processing Midterm Project: Project Image Clean Nicholas Steven Parisi Electrical and Computer Engineering Rowan University Glassboro, NJ USA [email protected]

Transcript of MidtermReport

Page 1: MidtermReport

1

Abstract— A group of assassins has attacked three diplomats of our neighboring allies. Our central intelligence agency has intercepted two images that could provide vital information to stopping them. These images were filled with noise and were rendered useless. However, a low pass FIR filter of length five was created in order to decode the images. The two images were cleaned up by the filter and were able to be read by our central intelligence agency.

Index Terms— lowpass filter, filter, FIR, cascade, Magnitude Spectrum

I. INTRODUCTION

Within the past ten days, three assassinations of high profile government officials have occurred. Fortunately, our secret service intercepted some images of suspicious activities. Unfortunately, the group of assassins knew ahead of time about our satellite. When the satellite took the pictures, absolutely nothing is visible. The picture was encrypted by the assassins to make it seem like noise ruined the satellite’s images. Figures 1 and 2 are the intercepted, distorted images.

Figure 1: Intercepted Signal 1

Figure 2: Intercepted Signal 2A filter is a special system designed to use remove or

modify some components from the input signal Filtering refers to intentionally altering the frequency content. The main component of the signal that will be altered is the frequency. In order to remove noise, for example, the filter will remove the frequencies that correspond to noise. Filtering is one of the most important applications in signal processing mainly because of it used to extract all the relevant information in a signal.

There are five typical designs for filters: lowpass, highpass, bandpass, bandstop, and notch. A lowpass filter removes high frequency signals while keeping low frequencies, while highpass filters do the opposite. Bandpass filters keeps an interval of frequencies and removes those not in the interval, while bandstop filters do the opposite. Notch filters simply remove a certain frequency.

Figure 3: Cascade LowPass Filter

1

ECE 09.351.02 Digital Signal Processing Midterm Project: Project Image Clean

Nicholas Steven ParisiElectrical and Computer Engineering

Rowan UniversityGlassboro, NJ USA

[email protected]

Page 2: MidtermReport

2

Cascaded filters are efficient ways to implement lowpass filters. Cascade filters are very important to signal processing. Dr. Nidhal Bouaynaya said in lecture that cascading filters turns a pathetic filter into a pretty decent filter. Those are not her exact words, but they stuck to me. Essentially, when a signal is sent through a cascade lowpass filter, the signal is sent through a lowpass filter. That result is sent through the filter again. That process repeats for as long as you want.

II.METHODS/ EXPERIMENTAL PROCEDURE

In order to devise a strategy to decode the encrypted pictures, the pictures first had to be loaded on MATLAB (load intercepted1.mat).

Using the knowledge that was previously learned in class, a lowpass FIR filter of length five was used.

The most important method in creating a low pass filter that would successfully decode these images was deriving the correct filter coefficients. The FIR filter used was of length five and symmetric, meaning the first two indexes of the array must equal the last two. The middle value that seperates the array was the value that was altered the most. A high number was picked at first (1). For the second choice in this series of trial and errors, the middle value was drastically decreased to 0.2. The middle integer was decreased as the quality of the image became clearer and clearer.

The process for filtering second image was a little bit different. After the image was intercepted and loaded into MATLAB, the middle value in the array was already set to 0.15. This was the successful value used to filter the previous image, so it was used to be starting point for this filter. Unlike the previous image, there was noise in both the vertical and horizontal direction. The other points in the array proved to be more critical in filtering compared to the previous image. The same properties of altering the middle term applied to the other terms.

To run plot the filtered image, imshow was used instead of image. When image was used to display the recovered, the image was unable to be read. The original distorted image was an image of blue and yellow, as seen below in Figures 3 and 4.

As stated in the Introduction, the idea to cascade the lowpass filters came from a DSP lecture. The signal is sent through the filter five times. That was the appropriate amount of times to filter the signal because the filter quality decreases as the amount of cycles are created. Once everything is filtered, the filter will start filtering the desired image because there is nothing left to clean.

Figure 4: Original Distorted Picture Ran with Image

Figure 5: Filtered Image Using Image

III. RESULTS

A. Part 1As previously stated in the methods section, a trial and error method was used to derive the correct array of filter coefficients. Below are the figures that were produced on the way to finding the most filtered image.

Figure 6: Filter Coefficients = [1 2 3 2 1]

2

Page 3: MidtermReport

3

Figure 7: Filter Coefficients = [.1 .3 1 .3 .1]

Figure 8: Filtered Image With a Middle Coefficient of .15

Figure 9: Middle Coefficient Equals .25

Figure 10: Best Result [.012 .07 .15 .07 .012]

Figure 11: Middle Coefficient Was Decreased Too Much (.10)

B. Part 2

Figure 12: First Attempt (.15)

3

Page 4: MidtermReport

4

Figure 13: 0.15 With the Last Cycle not Transposed

Figure 14: Middle Coeff= .13

Figure 15: Middle Coeff= .13, Ends Decreased

Figure 16: Middle Coeff= .11

Figure 17: Best Filtered Image [.032 .07 .128 .07 .032]

Figure 18: Increased the End Values Too Much

IV. DISCUSSION/CONCLUSION

The first image to decode in order to ensure the safety of foreign diplomats had to be loaded through a lowpass filter. The image was determined to be an antidote to prevent gas attacks. Many trials were conducted to find the best results, which can be found in the Results section. The strategy used to decode the image was to alter the middle term in the array. The array had to have the order of smallest, smaller, and

4

Page 5: MidtermReport

5

largest. The middle number absolutely had to be the largest. The two outer terms were mainly kept constant. They did not have as much of an effect on the image.

From conducting many trials, there were a few conclusions to draw. The conclusions are backed by the wide variety of images in the Results section. When the number in the array is increased, the image becomes brighter. The image becomes darker when the number is decreased. The number would be decreased to remove the bright glare. Eventually, the image will become entirely black. If the second term in the array is increased too much the picture, the image will have a solid black vertical lines.

The conclusions for the second image are similar. If both the first and second terms are increased too much, a black and gray checkered pattern is produced. If the middle term is increased too much while the others are decreased, the picture has a gray shade to it. This image had to be altered significantly. The amount of filter cycles that were transposed also affected the quality of the image.

Image intercepted1 was filtered exceptionally well where image intercepted2 was filtered modestly. I learned it was not difficult to design an FIR filter of length five is not that difficult and saving the world is a lot of work.

V. References[1] Polikar, R. “L12 - L13 Discrete Fourier Transform.”

Rowan University, 2014

[2] Polikar, R. “L16 – L17 Discrete Signals, Convolution, and

Frequency.” Rowan University, 2014

[3] Manolakis & Ingle, Applied DSP, Cambridge © 2012

VI. APPENDIX

A. Part 1 Code% Nicholas Steven Parisi% April 9, 2015% Midterm Project% Part 1 %loads the first image intercepted by the satelliteload 'intercepted1.mat' % Filter Coefficientscoeff= [.012 .07 .15 .07 .012]; %Length = 5, symmetric filter % Filter is cascaded to improve quality of the filter.%cycle is the name for what cycle in the cascade filter cycle%tried conv2, too many erroscycle1= filter2(coeff, intercepted1);cycle2= filter2(coeff, cycle1);cycle3= filter2(coeff, cycle2);cycle4= filter2(coeff, cycle3);cycle5= filter2(coeff, cycle4); % Plot of filtered and not filtered images

figure(1)image(cycle5) %tried image, horrible quality title('Intercepted1: Filtered') figure(2)image(intercepted1)title('Intercepted1: Original Image')

B. Part 2: Code% Nicholas Steven Parisi% April 9, 2015% Midterm Project% Part 1 %loads the first image intercepted by the satelliteload 'intercepted1.mat' % Filter Coefficientscoeff= [.012 .07 .15 .07 .012]; %Length = 5, symmetric filter % Filter is cascaded to improve quality of the filter.%cycle is the name for what cycle in the cascade filter cycle%tried conv2, too many erroscycle1= filter2(coeff, intercepted1);cycle2= filter2(coeff, cycle1);cycle3= filter2(coeff, cycle2);cycle4= filter2(coeff, cycle3);cycle5= filter2(coeff, cycle4); % Plot of filtered and not filtered imagesfigure(1)image(cycle5) %tried image, horrible quality title('Intercepted1: Filtered') figure(2)image(intercepted1)title('Intercepted1: Original Image')

5