Appropriate time window in PSD calculation

Hi Francois,

I have a continuous EEG with epochs of 20 seconds and 45 seconds. For calculating the PSDs of the epochs I wonder if there is any formula to find the optimum “time window”? Or you have any suggestion for me? I am willing to calculate the ERS/D of 45-sec epoch based on 20-sec epoch (= baseline) (ERS/D of frequency).

I already read the points in the tutorial about increasing the output resolution and degrading the stability of the estimator with manipulating this window. Then, I tried different time windows, which provided me the same pattern but with very different powers of each electrode site (decreasing time window increases the power).

Thanks ahead.

Cheers,
Mojtaba

Hi Mojtaba,

There is no optimal window length. Try to find a window length that gives you the frequency resolution you need.

For example, at 1000Hz, a time window of 1 second has 1000 time points.
The corresponding FFT has 1024 frequency bins (next power of two), and we keep only half of it (512 values) to represent the first half of the spectrum (0-500Hz).
So the final frequency resolution is 500Hz/512 = 0.98Hz (distance between two time bins).

If you increase a lot the frequency resolution (eg 0.1Hz), you observe three things:

  1. The value for each frequency bin would be 10x lower in average because the same signal power is divide among more frequency bins.
  2. You would observe more “noise” is frequency domain (lots of meaningless peaks) in the FFT, which may be cancelled out during the PSD average. This may also lead to lower values.
  3. You would have less windows to average, therefore the PSD estimation would be less stable.

Cheers,
Francois