5
$\begingroup$

At work we were smoothing a signal by convolving with either

f1=[0.2000 0.2000 0.2000 0.2000 0.2000]

or

f2=[0.1111 0.2222 0.3333 0.2222 0.1111].

A colleague noticed that f1 smoothed "stronger" than f2 and suggested a new filter:

f3=[0.2727 0.1818 0.0909 0.1818 0.2727] 

His reasoning was that this should smooth even "stronger" than f1, and therefore be better.

My answer to this was that

  1. if he wanted "stronger" smoothing he should instead increase the size of the filter

  2. a good smoothing filter should always approach zero at the start and beginning

My motivation for 2. was Gaussian filters which are often used for noise reduction in image analysis.

Is 2. correct?

Also because of the periodic nature of DFT does not f3 have the same frequency response as

f4=[0.0909 0.1818 0.2727 0.2727 0.1818],

which in turn should have a very similar frequency response as f2?

Edit: I followed Jim Clay's suggestion and zero padded and the result shows that f3 has terrible stop band ripple while f2 is quite OK in this respect: enter image description here

Thanks in advance for any answers!

$\endgroup$

2 Answers 2

4
$\begingroup$

As to your point 1, F1 appears to smooth more because it is wider, in terms of its 2nd moment width, an thus has a slightly lower and sharper transition. But a rectangular filter will have terrible stop-band ripple in exchange.

Low stop band ripple does require a filter not to have any sharp transitions, at the ends especially as the 2nd derivative gets really large which puts all kinds of high frequency stuff in the frequency response.

$\endgroup$
2
  • $\begingroup$ I understand stop band ripple is bad if you want to to spectral analysis, but does it matter if we stay in the time domain? What artefacts will it introduce? $\endgroup$
    – Andy
    Commented Mar 28, 2012 at 6:34
  • $\begingroup$ @Andy : Various. In the case of a rectangular convolution kernel, rings and halos and Moire patterns might be among the possible artifacts. $\endgroup$
    – hotpaw2
    Commented Mar 28, 2012 at 7:58
6
$\begingroup$

Yes, in general, your #2 is correct. That being said, both of the filters stink (with your triangle filter being a little better).

No, f3 does not have the same frequency response as f4. To get an idea of why that is so, you generally have to zero-pad the impulse response before DFT'ing it to get a reasonable idea of what its frequency response looks like.

$\endgroup$
2
  • $\begingroup$ Thanks! I did not know that one should zero-pad before doing DFT. This is often called "spectral interpolation" so it sounded to me like it pretends to add information that is not really there. However since my kernels are so short I guess one must zero-pad. $\endgroup$
    – Andy
    Commented Mar 28, 2012 at 6:48
  • $\begingroup$ @Andy The DFT of zero-padded signals results in you just interpolating the frequency domain result. This just means that you will have a smoother 'visual' result, but it is not adding more information per se. 'More information' here would mean being able to discriminate finer frequencies, which means your main lobe width becoming less wide. Zero-padding doesnt change reduce main lobe width, it just interpolates the already existing main lobe. (In the F-domain). $\endgroup$
    – Spacey
    Commented Mar 28, 2012 at 17:34

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.