This question already has an answer here:

I have an issue with my DFT. I think that I got how to fix it, but I lack the intuition on why there was a problem, and why my solution fixes it.

I have to apply DFT to a noisy signal. The second task is zeroing frequency bins with the highest frequencies to only get low frequencies, as suggested in this post.

When I apply this method, it seems that I get sharp increase/decrease at the end and at the beginning of my signal:

DFT results

Here the blue line is the results of the inverse DFT after zeroing some frequency bins for the entire signal. The other lines show the exact same process when I cut my signal. As you see I always have the same pattern with exploding values at the end of the signal. Of course these inscreases do not represent what is really happining in my initial signal.

The only solution I found is zero padding at the beginning and the end of my signal. When I do this the output is coherent.

Why do I have this issue, and why zero padding seems to correct it ?



marked as duplicate by Stanley Pawlukiewicz, MBaz, lennon310, Matt L., A_A Dec 24 '18 at 20:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.