9
$\begingroup$

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?

$\endgroup$

migrated from stackoverflow.com Mar 15 '12 at 12:50

This question came from our site for professional and enthusiast programmers.

  • 4
    $\begingroup$ 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. $\endgroup$ – hotpaw2 Mar 14 '12 at 2:39
  • $\begingroup$ Please describe your application in more detail. $\endgroup$ – nibot Mar 16 '12 at 21:27
3
$\begingroup$

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.

$\endgroup$
14
$\begingroup$

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

Just multiply, point-by-point.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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