Friday, July 19, 2019

Removing an unwanted sinusoidal signal using FIR filter


I am learning about the $\mathcal Z$-transform and FIR filters and I do have problem with the following exercise:



There is given signal $$x[n] = s[n]+\sin\left(2\pi f_n n\right)$$ where $s[n]$ is a useful signal, while sinus is an interference. Let's assume, that we use FIR filter to remove the interference. Where should be placed zeros of a transfer function to completely remove sinusoidal signal?


Sampling frequency: $f_s=10\textrm{ kHz}$


Sinusoid's frequency: $f=2.5 \textrm{ kHz}$




Here is my attempt:


$$f_n=\frac{f}{f_s}=\frac{1}{4}$$


\begin{align} y[n]&=x[n]\star h[n]\\ &=s[n]\star h[n]+\sin\left(2\pi f_n n\right)\star h[n]\\ \implies Y(z)&=S(z) \cdot H(z)+ \underbrace{\mathcal{Z}\left\{ \sin\left(2\pi f_n n\right)\right\} \cdot H(z)}_0 \end{align}


thus


$$0=H(z)\cdot\frac{z\sin\left(2\pi f_n\right)}{z^2-2z\cos\left(2\pi f_n\right)+1}$$


In general FIR filter is given by equation


$$H(z)=b_0+b_1z^{-1}+b_2z^{-2}+\dots$$


hence


$$\left(b_0+b_1z^{-1}+b_2z^{-2}+\dots\right)\cdot\frac{z}{z^2+1}=0$$



And I am stuck here. What to do next?



Answer



A very straightforward-answer, without a lot of calculation:


The magnitude of the frequency response of a filter is the magnitude of its z-Transform on the unit circle. Hence, if your filter should filter out a specific frequency, it needs to have a zero at exactly this frequency in the unit circle.


Considering that $f_s=10kHz$, a full rotation on the unit circle relates to $10kHz$. A sine has frequency components at $f_n$ and $-f_n=f_s-f_n$ (considering the periodicity of the DTFT due to the sampling). Hence, there need to be zeros at 2.5kHz and 7.5kHz, corresponding to 90 and 270 degree on the unit circle. Accordingly, the zeros need to be at $z=\pm j$.


No comments:

Post a Comment

digital communications - Understanding the Matched Filter

I have a question about matched filtering. Does the matched filter maximise the SNR at the moment of decision only? As far as I understand, ...