10

How can I apply a window function like Hamming or Lanczos to a signal, using its coefficients?

I mean, which method can I use to do this? FFT? Convolution? Which method has the better performance?

Lorem Ipsum
  • 5,944
  • 3
  • 34
  • 42
walteram
  • 203
  • 1
  • 2
  • 5
  • 4
    One typically does a vector multiply of a window function, scaled to the same vector length as the data, and the data vector, before an FFT. – hotpaw2 Mar 14 '12 at 02:39
  • Please describe your application in more detail. – nibot Mar 16 '12 at 21:27

2 Answers2

17

How can I apply a window function like Hamming or Lanczos to a signal, using its coefficients?

Just multiply, point-by-point.

nibot
  • 3,803
  • 5
  • 29
  • 40
4

I wrote this long answer for someone yesterday on stackoverflow.com . .

https://stackoverflow.com/questions/9694297/matlab-fft-xaxis-limits-messing-up-and-fftshift/9699983#9699983

It is a matlab based example showing how to use the FFT for analysis, but it might give you some ideas About half way through the second code block, I apply a window function to a buffered signal. This is effectively a vector multiplication of the window function with each buffered block of time series data. I just use a sneaky diagonal matrix trick to do it efficiently.

learnvst
  • 1,513
  • 2
  • 17
  • 25