You are on page 1of 9

ECE 3512 Spring 2011 (Assignment #4)

Designing and Implementing Analog Filters


Nabidur Rahman & Asish Mathew
AbstractA Filter is a device or process that removes unwanted components and frequencies from a signal. They are used in Signal processing to reject certain elements such as noise. Noise is an error or undesired disturbance of a signal, and filters can be designed to eliminate the noise as much as possible while retaining the original signal. Using intuition and knowledge of various filters, we can show that different filters have various processes on eliminating certain frequencies. Furthermore, we can observe which type of filters are primarily effective to removing noise from signals that have specific elements such as square or sawtooth components.

the noise, but not entirely. A digital filter would respond to this situation much better, as they are designed to calculate mathematical operations on a sampled, discrete-time signal to reduce or enhance certain aspects of that given signal. Essentially, this assignment gives the user many options to consider in solving the problem, which further gives us a hindsight as to how different types of filters work and which ones are better in situations such as removing noise than others.

II. PROCEDURE AND RESULTS (PART 1 SOLUTION 1) I. INTRODUCTION

|X(w)|

HE objective of this assignment is to design and implement filters that are capable of eliminating as much noise as possible to reveal the actual signal that is contained within the noise. This assignment also gives us filtering in a practical setting. Almost all signals such as images, video, sound, 3G broadband, and ECG carry a disturbance which is most commonly known as noise. Noise is created by many contributing factors such as electrical equipment, acoustics, audio hum, and the interference of another signal. Our objective is to demonstrate implementing a filter that can actually reduce the unwanted disturbance of the signals given. We are provided with two noisy signals: one sawtooth and one square. To design such a filter, we must first analyze the signal and see which frequencies hold the most abundant quantity of noise. Based on this intuition, we can study the Fourier Transform of these noisy signals and reveal their frequency domains to further assist us into designing a filter that can reduce the noise yet keeping the harmonics intact.

The assignment is two-fold: removing the noise from both the sawtooth wave and the square wave. Part 1 of the experiment asks us to denoise the sawtooth signal. To begin the analysis, we use MATLAB to plot the noisy sawtooth signal and its respective Fourier Transform. Results of this experiment are shown below:
Noisy Sawtooth Signal 5

x(t)

-5

0.005

0.015 0.02 time (sec) Fourier Transform of Noisy Sawtooth Signal

0.01

0.025

0.4 0.3 0.2 0.1 0

There are many possible filters that can solve this problem, notably a low or high pass filter. Other filters such as bandpass, butterworth, or notch can assist in reducing the noise but it is critical to note what kind of signal is given and it component structure. Using MATLAB, we can design analog filters that can denoise the two signals and plot its resulting output. It is important to note what type of filter is being implemented, and our assignment is constricted on using just analog filters. Analog filters can never completely eliminate the noise in any signal because of the restricted amount of computation it can solve on an intricate signal. The technical term can be denoted as Passive linear analogue filter, which are composed of linear differential equations that are designed to operate on continuously varying analog signals. Implementing an analog filter in our circumstance will reduce

1000

2000

3000 frequency (Hz)

4000

5000

6000

Figure 1 Noisy Sawtooth Signal and its Respective Fourier Transform Using intuition and observing the signals behavior, we can observe that the noisy signal follows the shape of a sawtooth wave. From the Fourier Transform, we can see the harmonics of the sawtooth signal decreasing at higher frequencies with an unexpected peak at 5000 Hz. The diminishing harmonics are expected because harmonic frequencies of a sawtooth signal tend to decrease at higher frequencies but this signal shows a disturbance at 5000 Hz. We conceive this to be the noise that is attributed to this signal. Several filters can be designed to

ECE 3512 Spring 2011 (Assignment #4) remove the noise, including a generic Low Pass Filter. We know that a Low Pass Filter retains low frequencies and rejects high frequencies at the specified cutoff frequency. We decided to create a test bench that implements three different filters: Butterworth, Chebyshev, and Elliptical. We designated the cutoff frequencies of all the filters at = 1000 Hz. The results of this procedure are shown below:
Test Bench of each Filter and their Response 1 0.9 0.8 0.7 0.6 |X(w)| 0.5 0.4 0.3 0.2 0.1 0 X(w) Butterworth Chebyshev Elliptical

2 passband ripple of 3dB with a stopband gain at 40dB. Using MATLAB, the transfer functions of each filter are shown below: = 2.48 10 1 + 7.9 10 + 2.48 10

12570

6.22 10 2 + 3753 + 3.67 10 + 6.22 10 347.3 1.046 10 + 6.92 10 3 + 3713 + 3.75 10 + 6.92 10

Equation 1 Transfer Function of 3rd order Butterworth Filter Equation 2 Transfer Function of 3rd order Chebyshev Filter Equation 3 Transfer Function of 3rd order Elliptical Filter The reason as to why we are computing these transfer functions is to further help us study these types of filters and how they are designed. In class, we discussed the effects a pole or zero has on the magnitude plot of a transfer function. Every subsequent pole gives a decrease of 20dB per decade as opposed to a zero giving an increase of 20dB. The main importance of a filters transfer function is the location of the poles and how their locations affect the resulting filter response. The pole-zero map of the three transfer functions shown above are given below:
1.5 x 10
4

1000

2000

3000 frequency (Hz)

4000

5000

6000

Figure 2 3rd order Filter Responses with cutoff frequency at 1000 Hz shown with Legend describing which Filter Response associated with which Color We can see from Figure 2 the resulting effects the filters would have in eliminating the 5000 Hz noise. The cutoff frequency for each filter is at 1000 Hz, which we can confirm by observing the 0.707 intersecting point. We can observe that the Butterworth filter has a steady dropoff towards 5000 Hz whereas the Chebyshev and Elliptical have a steeper dropff. However, we can also observe that the Elliptical Filter and the Chebyshev filter is eliminating more than just the 5000Hz noise, as frequencies ranging from 2000 Hz and above are being rejected as well. Since the harmonics are being depleted in the process, we expect the resulting output to look like a sawtooth but without the normal sharp edges. It is also important to note the transfer function of each filter since it will describe the order of each filter and its specified cutoff. To show the order of each filter used to show Figure 2, we present the MATLAB Code used to compute the filter response: [numb,denb] = butter(3,2*pi*1000,'s'); [numc,denc] = cheby1(3,3,2*pi*1000,'s'); [nume,dene] = ellip(3,3,40,2*pi*1000,'s'); The Butterworth filter has a order of 3 with a cutoff at 1000Hz. The Chebyshev Type 1 Filter has an order of 3 as well with a passband ripple of 3dB at the same cutoff frequency. Finally, the Elliptical filter has an order of 3 with a

Pole-Zero Map of Filter's Transfer Function Butterw orth Chebyshev

Elliptical

0.5 Imaginary Axis

-0.5

-1

-1.5 -7000

-6000

-5000

-4000

-3000 Real Axis

-2000

-1000

1000

Figure 3 Pole-Zero Map of the Filters Transfer Functions with each showing a different location The Pole-Zero Map is showing the location of the poles and zeroes of our computed transfer functions. We can observe that each filters transfer function has both real and complex poles, with the Elliptical Filter containing two complex zeroes. Complex poles tend to improve a filters response in rejecting high frequencies such as Butterworth Filters.

ECE 3512 Spring 2011 (Assignment #4)


FFT of Filtered Sawtooth using Butterworth

3
0.4 |X(w)| 0.2 0 0 1000 3000 4000 5000 frequency (Hz) FFT of Filtered Sawtooth using Chebyshev 2000 6000

Consequently, complex zeroes result in giving the stopband of a filter; therefore, it is associated with the Elliptical Filter. This is expected because these types of filters consist of these pole elements. Although we were not required to display this information, it is very important to understand what a filters transfer function is and how the location of the poles determines the filter response and how well it reduces frequencies specified by the cutoff. Now that we have discussed our proposed filters and their respective transfer functions and pole-zero maps, we can now observe if the filters we designed were successful in removing the noise. The results are shown below:
Results of Butterworth Filter 1 x(t) 0 -1 0 0.005 0.015 time (sec) Results of Chebyshev Filter 0.01 0.02 0.025

0.4 |X(w)| 0.2 0 0 1000 3000 4000 frequency (Hz) FFT of Filtered Sawtooth using Elliptical 2000 5000 6000

0.4 |X(w)| 0.2 0 0 1000 2000 3000 frequency (Hz) 4000 5000 6000

Figure 5 Fourier Transforms of the Filtered Signals using the filters described in the title of each graph.

1 x(t) 0 -1 0 0.005 0.015 time (sec) Results of Elliptical Filter 0.01 0.02 0.025

1 x(t) 0 -1 0 0.005 0.01 0.015 time (sec) 0.02 0.025

Figure 4 Resulting Outputs when our Filters are implemented. Title describes the output with the Filter associated in giving the Results.

The results in Figure 5 are within expected range if we observe each filters response shown in Figure 2. We can observe that the Chebyshev and Elliptical filters removed all the harmonics of the sawtooth signal from 1200 Hz and onwards. As we described before, the Butterworth Filter retained more harmonics than the other two filters but still reduced important harmonics that generate the sharp edges of a sawtooth wave. However, we are still not convinced that this is the best approach in removing the 5000 Hz noise. We now understand that after filtering the noisy sawtooth signal, the noise cannot be completely removed and that each filter designed and implemented required a trade-off. We then decided to design the simplest of all analog filters to see its overall effect in removing the noise: a simple Low Pass filter. III. PROCEDURE AND RESULTS (PART 1 SOLUTION 2) Using the Butterworth, Chebyshev, and Elliptical filters had given us a good perception on how to tackle the noise and how to eliminate it. We then decided to design a simple low pass filter and observe its resulting output and compare it with the results seen in Figure 4. The results of this are shown below:
Filter Response of Low Pass Filter at 2000Hz cutoff 1 0.9 0.8 0.7 0.6 |X(w)| 0.5 0.4 0.3 0.2 0.1 0 X(w) LPF

Upon comparing the three results, we can see that all three filters were successful in removing most of the noise. We can still see remnants of the 5000 Hz noise, which is expected since the noise cannot be entirely removed from a signal. The results are interesting to observe since each output shows a different rendering of the sawtooth signal. The Butterworth filter seems to show the best result when compared to the other filter outputs. However, the resulting sawtooth signal has lost its sharp edges since the filter also eliminated the high frequency harmonics that create them. The Chebyshev Filter and the Elliptical Filter both produce extremely similar results (Figure 2 shows their behavioral characteristics almost the exact same) with passband ripples where the sharp edges should be. If we take the Fourier Transform of each output signal, we can see which frequencies the filters reduced and how that attributed to the results shown in Figure 4. The Fourier Transforms of each output are shown on the right respectively in order:

1000

2000

3000 frequency (Hz)

4000

5000

6000

ECE 3512 Spring 2011 (Assignment #4) However, it stands to see that a first order Low Pass filter is not sufficient enough in eliminating the 5000 Hz noise. We decide to create another test bench where multiple orders of our Low Pass Filter are shown and their resulting filter response. We know that the transfer function of a low pass filter is: 1 = 4 + 1
x(t) Denoised Sawtooth Signal using LPF 1.5

0.5

Using the above equation, we can compute the filter response to a higher order, which is simply H(s) multiplied by the order specified. The number of orders denotes the number of poles the resulting transfer function will have. Using equation 4, we show the resulting filter response for each order:
Filter Response of Nth order Low Pass Filter 1 0.9 0.8 0.7 0.6 |X(w)| 0.5 0.4 0.3 0.2 X(w) 1st order 2nd order 3rd order 4th order 5th order 6th order

-0.5

-1

-1.5

0.005

0.01 time (sec)

0.015

0.02

0.025

Figure 8 Denoised Sawtooth Signal using 6th order Low Pass Filter at a cutoff frequency of 2000Hz We can observe that the Low Pass Filter does a much better job than a Chebyshev or an Elliptical Filter shown in Figure 4. However, there is still some distortion remaining in the signal due to the remnants of the noise and the usual sharp edges now show a rounder curve. The original and filtered Sawtooth Fourier Transforms are shown below for further analysis:
Fourier Transform of Noisy Sawtooth Signal 0.4

0.1
0.3 |X(w)|

1000

2000

3000 frequency (Hz)

4000

5000

6000

0.2 0.1

Figure 6 1 order Low Pass Filter at fc=2000 Hz (Page 3, bottom right) Figure 7(Above) Test Bench showing 1st - 6th order filter response of designed Low Pass Filter
|X(w)|

st

1000

3000 4000 5000 frequency (Hz) Fourier Transform of Denoised Sawtooth Signal

2000

6000

0.4 0.3

From Figure 7, we can see that a 5th and 6th order filter completely eliminates the 5000 Hz noise. However, as we discussed earlier about the Butterworth filter, harmonic frequencies at 4000 Hz and above are also being reduced as well. This is a crucial element to consider when designing a filter, since our objective is to retain the original signal as much as possible and remove as much noise as possible. Using trial and error, we received the best results when the noisy sawtooth signal was filtered with a 6th order Low pass filter at a cutoff of 2000 Hz, which is the equivalent of passing through our Low Pass Filter 6 times. The resulting sawtooth signal after implementing the filter is shown on the right with its respective Fourier Transform:

0.2 0.1 0

1000

2000

3000 frequency (Hz)

4000

5000

6000

Figure 9 Comparison of the Fourier Transforms of the Original vs. the Filtered Sawtooth Signal As expected, the Low Pass Filter eliminated the 5000 Hz noise and the harmonic frequencies from 2000 Hz and above. Since the high frequency harmonics were eliminated, the resulting sawtooth signal has lost its usual sharp edge. We can see that the Butterworth and the Low Pass both produced the best results in reducing the noise. We then stumbled upon an even better filter to handle this task: the Notch Filter.

ECE 3512 Spring 2011 (Assignment #4) IV. PROCEDURE AND RESULTS (PART 1 SOLUTION 3) Different types of filters can be designed to handle specific requirements. For example, a Low Pass filter retains low frequencies and rejects high frequencies above the specified cutoff. During our research of various filters, we discovered how some filters implement the characteristics of a Low Pass Filter but have a different output behavior. We already seen these methods take place in our designed Chebyshev, Elliptical, and Butterworth filters, where the transfer function and pole locations affected the filter response and how well each handled the reduction of the 5 kHz noise. As we studied these types of filters, we discovered more filtering techniques such as Band-passing, Band-stopping, and Band-rejecting certain frequencies. The design characteristics of a Band-stop filter had caught our attention because a Band-stop filter will reject a certain range of frequencies specified by the user. Since we only want to remove the 5000 Hz noise and nothing else, implementing a Band-stop filter from 4900 Hz to 5100 Hz seemed like a very good option until we discovered an even better filter. During our research of Band-reject filters, we discovered a filter called the Notch Filter. Notch filters are a type of Band-stop filter that rejects a specific frequency. This makes the notch filter and ideal filter to implement in our situation, since it would be able to remove the 5000Hz noise without eliminating other frequency values. Using MATLABs built in Filter toolbox, we designed a notch filter with a specified cutoff at 5 kHz, which is the exact location of the noise. The magnitude response of our notch filter is shown below:
Magnitude Response Estimate

5 always has. Using just a single notch filter, the resulting sawtooth signal and its respective Fourier Transform are shown below:
Denoised Sawtooth Signal using Notch Filter 1.5

0.5

x(t)

-0.5

-1

-1.5 0.1

0.105

0.11

0.115 time(sec)

0.12

0.125

Figure 11 Denoised Sawtooth Signal using a Single Notch Filter at 5000 Hz. Upon observation, we can see that the results are exactly what we expect. Since the high frequency harmonics that generate the sawtooth edges are still intact, the resulting signal shows that the notch filter is the best filter in reducing the noise. We can still observe that there is still some distortion remaining in the signal. As we discussed earlier, analog filters can never remove the noise entirely. To see if the Notch Filter eliminated the 5000Hz as we expect, the Fourier Transforms of the original noisy sawtooth are compared with the notch filtered sawtooth. Results are shown below:
Fourier Transform of Noisy Sawtooth Signal 0.4

0.1

Magnitude (dB)

-0.1

0.3
-0.2

|X(w)|

0.2 0.1 0

-0.3

-0.4

1000

-0.5

3000 4000 5000 frequency (Hz) Fourier Transform of Denoised Sawtooth Signal

2000

6000

0.4
0 5 10 15 Frequency (kHz) 20

0.3 |X(w)| 0.2 0.1 0

Figure 10 Magnitude Response Estimate of our designed 5000 Hz Notch Filter cutoff with a bandwidth of 100Hz Our intuition is that if we implement the Notch filter at 5 kHz, we can eliminate almost all the noise in the entire sawtooth signal and retain the sharp edges a sawtooth signal

1000

2000

3000 frequency (Hz)

4000

5000

6000

Figure 12 Fourier Transform of Original Noisy Signal compared with Fourier Transform of Filtered Notch Signal

ECE 3512 Spring 2011 (Assignment #4)


Fourier Transform of Noisy Square Wave

We can observe that the Notch filter we designed eliminated the 5000Hz noise as expected without affecting the sawtooth harmonics. This part of the assignment is critical to understand since it will help with Part 2 of the assignment, which asks us to remove the noise from a square wave signal.
|X(w)|

0.07 0.06 0.05

V. PROCEDURE AND RESULTS (PART 2 SOLUTION 1) Part 2 of this assignment is to remove as much noise as possible from the given Noisy Square Signal. As we did in Part 1, the first step is to analyze the signal in both the time and frequency domain. Using MATLAB, the results are shown below:
Noisy Square Wave 5

0.04 0.03 0.02 0.01 0

1000

2000

3000 4000 frequency (Hz)

5000

6000

Figure 14 Zoomed in view of the Fourier Transform, showing the location of the noise at all frequencies After zooming in on the bottom of the y-axis, we can see that the noise is finally located. The noise seems to be attributed to all frequency values, which means that the noise is everywhere in the signal. This type of noise is known as white noise, with the technical term as low power Gaussian noise since the noise is evenly distributed (binary distribution) throughout the signal. Filtering the white noise can be challenging since the odd harmonics that generate the square wave might be damaged in the process. As we did in Part 1 of this assignment, we will design another simple Low Pass Filter and observe the resulting output. From there, we can observe the noise remaining and its Fourier Transform for further analysis. We used a cutoff frequency of 2000 Hz and filtered the noisy signal 5 times, thus executing a 5th order Low Pass Filter. After implementing the filter to the Noisy Square Wave, the results of this experiment can be seen on the following page with its Respective Fourier Transform for further analysis.
5th order Low Pass Filter Response 1 0.9 0.8 0.7 0.6 |X(w)| 0.5 0.4 0.3 0.2 0.1 0 0 1000 2000 3000 4000 frequency (Hz) 5000 6000

x(t)

-5

0.005

0.015 0.02 time (sec) Fourier Transform of Noisy Square Wave

0.01

0.025

0.6 |X(w)| 0.4 0.2 0

1000

2000

3000 frequency (Hz)

4000

5000

6000

Figure 13 Noisy Square Signal and its Respective Fourier Transform

This is an interesting signal to analyze because the noisy signal barely resembles the characteristics of a square wave. Even more baffling is that unlike the noisy sawtooth signal, the Fourier Transform shows that there is no specific area the noise is located in. We resized the x-axis multiple times in hopes of getting an answer as to where the noise was located but to no avail. We can observe that the harmonic frequencies are diminishing at higher frequencies which belong to the square wave but no sudden impulses of noise such as the noisy sawtooth signal had. More importantly, the Fourier Transform is showing the odd harmonics of the square wave, which will be important to analyze in our Solution 2. After multiple attempts in locating the noise, we then realized an interesting behavior on the bottom of the y-axis. We zoomed in the bottom for further analysis, with the resulting figure shown on the right:

ECE 3512 Spring 2011 (Assignment #4)


Denoised Square Wave using 5th order Low Pass Filter 2 1.5 1 0.5

7 to retain the original signal as much as possible. We decided to do further research and implement various other filters to handle this task. When we did, we discovered not only the right filtering method, but a powerful new method in eliminating the noise as well. VI. PROCEDURE AND RESULTS (PART 2 FINAL SOLUTION)

x(t)

0 -0.5 -1 -1.5 -2

0.005

0.01 time(sec)

0.015

0.02

0.025

Figure 15 5th order Low Pass Filter Response (6th page bottom right) Figure 16 (Above) Denoised Square Signal after Filter was Applied We can observe that the abundant amount of white noise is removed and the results look similar to the shape of a square wave. However, the square wave is barely perfect, since our Low Pass Filter eliminated crucial harmonics that generate the square shape. We can see this in the following figure, where the original Fourier Transform is compared with the filtered transform. Results can be seen below:
Fourier Transform of Noisy Square Wave 0.6 |X(w)| 0.4 0.2 0

The reason we designed a simple Low Pass filter to eliminate the noise is to study the output behavior and see if a better solution can be created to solve the problem. Since the odd harmonics of a square wave create the square shape, we knew that they were important to keep for any filter design to remove the white noise. If we were to eliminate the noise between the odd harmonics, the results would look much better. A zoomed in view of this methodology is shown below for further analysis.
Fourier Transform of Noisy Square Wave 0.08 0.07 0.06 0.05 |X(w)| 0.04 0.03 0.02 0.01 0

100

200

300 400 frequency (Hz)

500

600

700

1000

3000 4000 5000 frequency (Hz) Fourier Transform of Denoised Square Wave

2000

6000

Figure 18 Zoomed in View of the Fourier Transform of a Square Wave showing odd harmonics at 200Hz and 600Hz with white noise distributed at all frequencies We can see from Figure 18 that the odd harmonics are located at 200Hz and 600Hz. This means that the odd harmonics of the square wave repeat itself every 400 Hz. If we can eliminate the noise between 200 600 Hz, we can do a much better job in retaining the original square wave. In our research, we discovered a new and powerful method in eliminating noise from the Square Wave, which is called Spectral Subtraction. Spectral Subtraction is a method where a signal can be subtracted from another to eliminate key components. In our situation, we can employ spectral subtraction to eliminate the noise in the signal.

0.6 |X(w)| 0.4 0.2 0

1000

2000

3000 frequency (Hz)

4000

5000

6000

Figure 17 Comparison of Fourier Transforms of the Original Noisy Signal vs. the Filtered Signal

As we described earlier, the Low Pass filter eliminated the white noise from 2000 Hz and on but also eliminated the odd harmonics that create the square signal. This is not the best approach in filtering the white noise since our objective is

If we look at the Fourier Transform of the Noisy Sawtooth Signal, we can see the odd harmonics at one specific frequency as opposed to multiple frequency values. We can make a copy of the original noisy signal for this method to

ECE 3512 Spring 2011 (Assignment #4)


Fourier Transform of Noisy Square Signal

8
0.08 0.06 |F(w)| 0.04 0.02 0

|F(w)|

work. If we designed notch filters to eliminate the odd harmonics in the copied noisy signal, the only element that would remain in the signal is the noise. Then, we can use the method of spectral subtraction and subtract the original noisy signal with the all noise signal. In doing so, the white noise contained between the odd harmonics would be eliminated. To retain the original square wave from the noise, we have to keep as many odd harmonics as possible. We decided to design multiple notch filters in cascading form to eliminate the odd harmonics of the square wave. A total of 10 notch filters were designed, with a bandwidth of 100Hz for each. Several diagrams below show this methodology at work:
Fourier Transform of Noisy Square Signal 0.8

500

1000

1500 2000 2500 3000 frequency (Hz) Results when 5 Notch Filters are Applied

3500

4000

0.08 0.06 0.04 0.02 0

0.6 |F(w)| 0.4 0.2 0

500

1000

1500 2000 2500 frequency (Hz)

3000

3500

4000

Figure 20 Original Fourier Transform compared with Fourier Transform of Noisy Square with 5 notch filters implemented at the base frequencies of the odd harmonics.
0 500 1000 1500 2000 2500 3000 frequency (Hz) Results when Notch Filter is Applied 3500 4000

0.4 0.3 |F(w)| 0.2 0.1 0

We can observe from Figure 20 that the notch filters are eliminating the odd harmonics just as we expect. We decided to implement 10 notch filters for the first 10 odd harmonics. Once this entire process was complete, the resulting signal consisted of nothing but the white noise. Results shown below:
Resulting Fourier Transform after Notch Filtering 0.03

500

1000

1500 2000 2500 frequency (Hz)

3000

3500

4000
0.025

Figure 19 Comparison of the Fourier Transforms of the Original Noisy Square vs. the Filtered Transform
|F(w)|

0.02

0.015

The results shown are expected since we implemented a notch filter at 200Hz. If we look at Figure 18, the odd harmonics of the square wave are subsequent integers of 400Hz. That means the odd harmonics are located at: 200, 400, 1000, 1400, 1800, 2200 Hz. and our intuition is to notch filter each harmonic so that the resulting Fourier Transform will be nothing but noise. Then, we can subtract the original Fourier Transform with the noisy signal to get a Fourier Transform that depletes the noise between 2 odd harmonics. To further show this method, the following figure on the right shows the Fourier Transform of the noisy square signal with 5 notch filters implemented at the first 5 harmonics:

0.01

0.005

500

1000

1500 2000 2500 frequency (Hz)

3000

3500

4000

Figure 21 Resulting Fourier Transform when all 10 notch filters were implemented Now that all 10 notch filters were implemented, the first 10 harmonics were eliminated, leaving nothing but white noise. Now we can employ our method of Spectral Subtraction and observe if the noise between the odd harmonics were eliminated. Results on following page:

ECE 3512 Spring 2011 (Assignment #4)

9 result in the time domain, we must take the Inverse Fourier Transform of our Subtracted Fourier Transform. Results are shown below:
IFFT of Filtered Signal 4 3 2 1 x(t) 0 -1 -2

Fourier Transform after the Signals were Subtracted 0.04 0.035 0.03 0.025 |F(w)| 0.02 0.015 0.01 0.005 0

500

1000

1500 2000 2500 frequency (Hz)

3000

3500

4000

-3 -4 0.02

Figure 22 Resulting Fourier Transform after the two specified Signal were subtracted From the Fourier transforms shown above, we can observe that the white noise between the odd harmonics have been significantly eliminated. The power of the white noise has also depreciated lower than 0.005 which means that the signal to noise ratio has decreased. Since the notch filters were designed with a bandwidth of 100Hz, a lesser bandwidth could have eliminated even more noise. To observe how much noise was eliminated, we can compare Figure 22 with the original noisy Square Signals Fourier Transform shown below:
Fourier Transform of Noisy Square Signal 0.04 0.035 0.03 0.025 |F(w)| 0.02 0.015 0.01 0.005 0

0.025

0.03 time(sec)

0.035

0.04

Figure 23 Resulting Square Wave after Inverse FT We can observe that our methodology worked, since the resulting figure resembles more of a square wave. There is still some noise remaining since the odd harmonics contains remnants of white noise. We can observe that the method of spectral subtraction was useful in this situation. By subtracting the all noise signal from the original noisy signal, the white noise between the odd harmonics were eliminated. The noise could have been eliminated with more sophisticated filters such as digital FIR filters. Another method we could have used is auto-correlating the signal. Currently we are learning stochastic processes of signals and we are now studying autocorrelation and cross-correlation of several signals. By doing so, we could have isolated the noise and made the signal to noise ratio extremely low. However, these are advanced methods that are beyond the scope of this course and assignment. Analog filters can never eliminate all the noise from a signal, so our designed analog filters are sufficient enough to render a satisfactory result. VII. DISCUSSION After completing this assignment, we gained valuable experience in filtering and how each design implementation resulted in different outputs. We learned how a filter is designed by the transfer function, how the response changes with the number of poles and zeroes and their locations on the real and imaginary axis, and how their order improves the frequency cutoffs. This assignment also gave us knowledge on signal disturbances such as noise and how filters can be designed to eliminate noise as much as possible while retaining the original signal. We employed the method of spectral subtraction for the noisy square wave to get better results as opposed to Low Pass filtering it. This assignment provided methods of filtering in a practical setting, which we hope to use in future Signal Processing courses.

500

1000

1500 2000 2500 frequency (Hz)

3000

3500

4000

Figure 23 Original Noisy Square Waves Fourier Transform to be compared to Figure 22 shown above. As we stated earlier, a sufficient amount of white noise has been removed when observing the differences between Figure 22 and 23. This is good because now the resulting output will be much better than our original Low Pass Filter. To show the

You might also like