Apologies in advance, as I will be asking a question about a topic that I have no formal understanding of. If this question is better asked on the Digital Signal Processing subforum, please let me know, and I will promptly remove this post.

Suppose I have acquired some digitally sampled signal and want to 'filter out' a range of frequencies from this data. From my basic understanding of the discrete fourier transform (DFT) and the process used to create spectrograms (chunked DFTs - derived from different time windows of the original signal - that get pasted together), it seems like I could go about this in two different ways.

First Way

Perform a DFT on the entire original data. Set all frequency bins of non-interest to $0$ magnitude (perhaps this can be done in a 'smoother' process, but for the purpose of my question, it should not matter). Carry out the inverse DVT. Voila. You have your desired filtered signal.

Second Way

Acquire a spectrogram from the original data. Select the (finite number of) frequency bins of interest (all frequencies of non-interest can be set to $0$). For each DFT comprising the spectrogram, carry out an IDFT. Paste together, chronologically, all of the IDVT-produced time series (maybe with some sort of averaging rule where consecutive windows meet). Voila. You have your desired filtered signal.

The questions I have are as follows:

  1. Are both approaches valid?

  2. What are (conceptually) the different outcomes of each method?

  3. Is one method more conventional / preferable than the other?



1 Answer 1


If I understand your question correctly, your question is regarding whether the data you collected should be (1) processed as a whole block or (2) should be chopped into multiple smaller blocks and then these blocks are processed individually. In principle, either way is possible if they are done correctly, but with a few of important differences.

First of all, the processing block size is different. For instance, if you collected 64 data in total. With method (1), the DFT size is 64, while with method (2), the DFT size is 16 when each block is processed (if whole data block is chopped into 4 blocks without overlapping). This reduces the frequency resolution by a factor of 4. So if you want your analysis more accurate in frequency, better to use the method (1).

Secondly, when DFT is applied to a block of data, there is a Gibbs effect (GE) which degrades the accuracy of the frequency analysis due to the sudden change of the data values near the block boundaries. Thus, when method (2) is used, more block boundaries are created and each one is a source of Gibbs effect. While with method (1), only two boundaries in total exist.

In my opinion, method (1) is a better choice for your purpose. Usually method (2) is used for the purpose of removing (or reducing) the effect of noise and randomness of the data when the average power spectrum density (APSD) of a signal is to be analyzed, not for filtering.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .