3
$\begingroup$

I'm trying to derive an expression for the magnitude spectrum of the following sharpening filter.

$$ g(m,n) = \delta(m,n)+\lambda (\delta(m,n) - h(m,n)) $$

where $\lambda$ is some positive constant and $h(m,n)$ is a low pass filter.

$$h(m,n) = \begin{cases} \frac{1}{25}, & \text{for $|m| \leq 2, |n| \leq 2$} \\ 0, & \text{otherwise} \end{cases}$$

Using the linearity of Fourier transform, I get

$$ G(u,v) = 1+\lambda(1-H(u,v))$$

where $$ H(u,v) = \frac{1}{25} \cdot \frac{\sin\frac{5\mu}{2}\sin\frac{5\nu}{2}}{\sin\frac{\mu}{2}\sin\frac{\nu}{2}} \cdot e^{j\cdot 6(\mu+\nu)} $$

So, to get the magnitude spectrum, I make the following steps \begin{align*} |G(u,v)|^2 &= \big[(1+\lambda)-\lambda H(u,v)\big] \big[(1+\lambda)-\lambda H^*(u,v)\big] \\ & = (1+\lambda)^2-(1+\lambda)\lambda\cdot 2\Re \big\{H(u,v)\big\}+\lambda^2|H(u,v)|^2 \end{align*}

where $$ \Re\big\{H(u,v)\big\} = \frac{1}{25} \cdot \frac{\sin\frac{5\mu}{2}\sin\frac{5\nu}{2}}{\sin\frac{\mu}{2}\sin\frac{\nu}{2}} \cdot \cos(6(\mu+\nu)) $$

Therefore, to obtain the magnitude spectrum I should take the square root of the expression above.

However, the picture I get when I'm trying to plot it does not coincide with something that I'm expecting to see. I mean it's a high pass filter, hence there should be something like that.

enter image description here

But I get this.

enter image description here

Maybe there is a way to simplify this expression or maybe there is something that I'm doing wrong.

Thank your for your help!

$\endgroup$

1 Answer 1

1
$\begingroup$

UPD: I've figured it out myself. I was inattentive with the exponentials while deriving the expression for the low-pass filter $H(u,v)$. There shouldn't be $\cos(6(\mu+\nu))$ term, then the result is fine and $$\Re \big\{H(u,v)\big\}=\frac{1}{25} \cdot \frac{\sin\frac{5\mu}{2}\sin\frac{5\nu}{2}}{\sin\frac{\mu}{2}\sin\frac{\nu}{2}}$$

Therefore, \begin{align*} |G(u,v)|^2 &= \big[(1+\lambda)-\lambda H(u,v)\big] \big[(1+\lambda)-\lambda H^*(u,v)\big] \\ & = (1+\lambda)^2-(1+\lambda)\lambda\cdot 2\Re \big\{H(u,v)\big\}+\lambda^2|H(u,v)|^2 = [1+\lambda - \lambda H(u,v)]^2 \end{align*}

And the result is exactly what I was expecting to get.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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