Description
ZhenDi Pan 1003241823
1 A Notch Digital Filter
1. In complex analysis, a pole is a special singularity meaning the pole of a function is where the function denominator becomes 0. Whereas zeros is when the numerator becomes 0. Thus, this gives us the poles
of this system: z = p,z = p∗, which can rewritten as and . And the zeros of this system: . Since is positive, the poles are located outside
of the unit circle and the zeros are located on the circle. Thus the system is stable. Next, we prove the filter is real by showing any real input time series passed through the filter remains real. That is, for
all input ), so the filter is real.
2. As the lab handout instructed, we set fs = 12, f0 = 1, M = 1.04 and 04. The power spectrum
|W(f)|2 is plotted below:
3. If we want to make the notches sharper, we can simply decrease . This is essentially bringing the poles closer to the zeros. The ffwhm value of this notch filter can be observed when we zoom in on the plot from question 2:
As we can see, the points where y = 0.5 lie on the x-axis are about −1.1 − 0.9 approximately. Thus, the FWHM is about 0.2 cycles per year.
2 Implementing the Notch Filter
1. We can rewrite the notch filter in 1.2 as:
Dividing both numerator and denominator by |p|2 gives the filter in form of N(z) and D(z). Then the values for a; b; c; B; C:
2. See code file for the ratFilter function
3. Continuing from Question 1, we can can calculate |p2| = 1.0816 a = c = 0.962, b = B = −1.665,C =
0.925. By using the ratFilter function, the plot of impulse response from 0 to 6 years is shown below:
4. The plot is shown below:
To my understanding, the plot should theoretically resemble the shape of the previous plot, but I have no idea how this failed.
3 The Mauna Loa CO2 Data
Collaborator: Will Zeng, Shenzhi Wang
1. Using numpy function polyfit, we first fit a straight line through our original data:
Now we remove the straight line and plot both the original data and the detrended data.
2. Code from code file for applying the notch filter and adding back the trend:
filteredco2 = ratFilter (N,D, detrend co2 ) filtered co2 = filtered co2 + trend
3. The amplitude and phase spectrum plots are shown below:
Now we zoom in at f = [0,3.5]:
4. The plot is shown below:
We can see that the f-domain filtering method is better in terms of similarity to the original data, which means that it captures the trend of the original time series better. It also removes the fluctuations. The disadvantage of using this method would be instability, it does not deal with noises as well as the Notch filter. One other thing that is worth noting, implementing a notch filter for real world problem might become difficult because we have to pre-configure all the parameters, this is a potential disadvantage.
5. If we do not detrend before applying our filters, i.e using the original result for Part 2 and Part 3 and
Part 4, then the result is terrible:
The notch filtered data is not capturing the trend of the original time series as well as before, and the Fourier transform method is shifted drastically. Thus, we can see from purely from visual effect, just how important it is to detrend before applying filters. It tells us that not detrending the data will result in serious problems for capturing trend of the data.




Reviews
There are no reviews yet.