I have a analog signal that is converted into a discrete-time signal with an ideal A/D converter with a sampling frequency $fs$. The bandwidth of the signal of interest is $1 kHz$. The resulting signal $x[n] = x_a(nT_s)$ is then processed with a discrete-time system that is described by the difference equation:

$$y[n] = x[n]+ax[n-1]+bx[n-2]$$

The filtered signal, $y[n]$, is then converted back into an analog signal using an ideal D/A converter. I need to determine values for $fs$, $a$ and $b$ in order to remove a $60Hz$ interference that has a signal in the form: $i_a(t) = Asin(120 \pi t)$

By Nyquist, I know that the value of $fs$ needs to be greater than $2000Hz$, however, I don't know how to determine $a$ and $b$. Any thoughts?


The OP is trying to implement a notch filter with a 3 tap FIR filter (as restricted by the problem he is trying to solve). It must be noted that this would result in a very poor filter implementation: It will reject 60 Hz perfectly but will have unavoidable attenuation over a very broad section of the desired passband range. An actual practical implementation would be done with an IIR approach in order to provide a tight notch, as demonstrated by this link: Transfer function of second order notch filter

As a hint to determine the filter within this FIR restriction, as an exercise only and of no real practical value proceed as follows:

Take the Z transform of the difference equation.

Determine the transfer function form as a polynomial ratio $H(z) = Y(z)/X(z)$

From this know that the frequency response is determined by restricting $z$ to the unit circle ($z= e^{j\omega}$) with $\omega$ extending uniquely over the normalized radian frequency from $-\pi$ to $+\pi$ which corresponds to $-f_s/2$ to $+f_s/2$ where $f_s$ is the sampling rate.

Given this is an FIR structure, the transfer function will result in simply a 2nd order polynomial in the numerator (whos roots are the "zeros" of the filter). Place the zeros of this polynomial such that they corresponds to the 60 Hz locations on the unit circle (+/- 60 Hz for a real filter, mapped to the angular frequency as described above), which would provide complete attenuation at f = 60 Hz.

  • $\begingroup$ I get it! I agree with you, if I were to implement a notch filter properly, i would take into account the answer you mentioned. I got $a = -1.96457$ and $b=1$. Thanks! $\endgroup$
    – July H.
    Apr 23 at 1:14
  • 1
    $\begingroup$ @JulyH. Good job, what sampling rate did you end up using? I'll check your answer. What's interesting about the answer I referenced is that you just add a pole near this zero but inside the unit circle to be stable and wala! $\endgroup$ Apr 23 at 1:15
  • $\begingroup$ I used $f_s = 2000Hz$. I dont understand why in the PSET, the answer for $a$ is $-2cos( \frac{60}{f_s})$ $\endgroup$
    – July H.
    Apr 23 at 1:17
  • $\begingroup$ Look at Euler's identity for cos: $(1/2) e^{j \omega t} + (1/2) e^{-j \omega t}$ and then think of what I described in my answer: these are the desired root locations. I have to work through the math to check there/ your answer which may be the same. $\endgroup$ Apr 23 at 1:21
  • $\begingroup$ I see. But $a = 1.96457$ it's not a wrong answer, right? $\endgroup$
    – July H.
    Apr 23 at 1:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.