4
$\begingroup$

What is the difference of window types such as Hann, Rectangular, Hamming in the application. Is there such a thing that the one is better than the other?

$\endgroup$
6
  • 1
    $\begingroup$ huh, that's a question that sounds a lot like homework - what are your thoughts on this so far? What have you looked into? There's quite a bit on window functions out there (e.g. wikipedia), and I think you can give us an easier start at helping you when you try to describe your current research in a little more detail $\endgroup$ Jun 7, 2020 at 14:39
  • 2
    $\begingroup$ Awesome! I'm adding that to your question, because it greatly improves it. $\endgroup$ Jun 7, 2020 at 15:21
  • $\begingroup$ So, I think the oral examiner might ask you something like "why does main lobe width of our window function matter for our filter?" (more than they would ask "List windows and their applications"), so that information really changes your question quite a bit (and for the better, honestly!). So, let's actually work with that. It sounds like you already know what the window function in FIR filter design is used for, is that right? $\endgroup$ Jun 7, 2020 at 15:24
  • $\begingroup$ Yes, but unfortunately I didn't understand the idea behind exactly these kind of questions that you addressed Sir. $\endgroup$ Jun 7, 2020 at 15:29
  • 2
    $\begingroup$ that's what we'll be working on :)! (no need to call me "Sir", please. I'm probably not that much older, and certainly not more respectable than you are!) $\endgroup$ Jun 7, 2020 at 15:33

1 Answer 1

8
$\begingroup$

So, from the discussion in the comments it's clear you know most you need to know.

The window method for FIR filter design is based on this idea:

  1. We know the "ideal" frequency response $H(f)$ we want. Often, that's something like a rectangle in frequency design.
  2. Well, the easiest thing to achieve that shape would simply be transforming $H$ to time domain, yielding the impulse response $h(t) = \mathcal F^{-1}\{H\}(t)$.
  3. small problem here: If $H(f)$ is very steep, then the properties of the Fourier transform implies that $h(t)$ will be very long – in fact, if $H(f)$ is a rectangle (we call that the "brickwall" or "boxcar" filter, by the way), then $h(t)$ will be a sinc; and that is infinitely long. That's not useful for a FIR....
  4. So we decide we need to cut off $h(t)$ after some length. Now, if we simply decide to cut off at some point, we have multiplied with a rectangular window $w_\text{rectangle}$, and we know that this is equivalent with convolving with a sinc in frequency domain. And convolving our nice ideal frequency response $H(f)$ with a sinc will totally "smear" and make it round and wobbly – not really what we want, usually.
  5. Therefore, instead of using the rectangular window, we use a "rounder" window.
  6. Thus, we realize we need to find a trade-off between being "sharp" in frequency and not "too smoothly running out" in time domain (because that means our filter remains long).

Now, the filters you mention have different properties, and were all designed to fulfill some roles.

For example, the Hamming window has a very nicely suppressed first sidelobe in frequency domain – which means that after convolving our ideal $H$ with it, the transition from passband to stop band will show the same nice behaviour, and signals close to the edge of the passband are already well suppressed. That might be useful when you want to extract a single channel from many channels that lie close together in spectrum.

Hann, on the other hand, doesn't suppress the first sidelobe as much - but in exchange, the power of the sidelobes drop faster the further you get from the mainlobe. This helps you if you want to design e.g. an anti-aliasing filter, where all the frequency that you don't suppress ends up aliased in the passband.

Now, for your oral exam: Maybe head over to wikipedia's list of window functions, and look at the frequency domain plots of them. When your examiner asks you what the up- and downsides for a given window for a given application are, you'd start by explaining that you need to convolve the ideal frequency response with the spectrum of the window, and then work your way towards an answer.

If your examiner is like any of the examiners that I was the transcript writer for (or any examiner that orally examined me when I was still a student), then that ability to work towards a solution based on an understanding of windowing and an analysis of what the application calls for is far more interesting than the ability to have an answer to the question "What window will you use for designing an anti-aliasing filter?" instantly ready.

$\endgroup$
5
  • $\begingroup$ Thank you very very much, it is a great and detailed explanation. Now everything is much clear. $\endgroup$ Jun 7, 2020 at 15:55
  • 1
    $\begingroup$ You're utterly welcome! All the best for your exam :) by the way, you say "oral exam for DSP course": May I be as curious as ask what you study? Electrical Engineering? Bioinformatics? Computer Science? $\endgroup$ Jun 7, 2020 at 15:58
  • $\begingroup$ Biomedical Engineering and the course is Biomedical Signal Processing. So we were applying different filters in order to remove noises or interferences in ECG signals. Thank you, I hope so! :) $\endgroup$ Jun 7, 2020 at 16:12
  • $\begingroup$ That sounds pretty cool! Again, all the best for your exam, and your studies $\endgroup$ Jun 7, 2020 at 16:25
  • $\begingroup$ Thank you, also for your helps! $\endgroup$ Jun 7, 2020 at 16:50

Your Answer

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

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