compute PSD of a frequency of interest

Hi everyone,

  • MNE version: 1.0.3
  • operating system: macOS 11.1

I would like to know whether it is possible to compute the power spectral density of one specific frequency of interest, not in a range.

According to the manual (mne.time_frequency.psd_multitaper — MNE 1.2.dev0 documentation), we should input the lower- and upper-bound on frequencies of interest as one parameter, but for example, let’s say when I want to compute the PSD of exactly 5Hz, is there any way to do that?
Thank you!

There is sort of a way to do that: set it up so that one of your frequency bins lands at exactly 5 Hz, ignore all the other bins, and accept the fact that each bin will always have some non-zero bandwidth.

In general the number of frequency bins is determined by the window length: n_bins = n//2 + 1 where n is the window length (in samples). The values of the frequency bin centers are determined by that and by the sample spacing (inverse of sampling frequency). So for example, say your sampling frequency is 500 Hz. The highest estimable frequency (Nyquist) is 250 Hz. Say you want bin spacing of 1 Hz (then your 5 Hz component would represent power between 4.5 and 5.5 Hz), so 251 bins, so your window length n should be 500. If you want finer resolution (smaller bandwidth for each bin) then the window length needs to be proportionally longer.

nitpick: if you’re looking at a single frequency, then it’s not density anymore, it’s just power. But as mentioned above, with sampled (not time-continuous) signals there will always be an implicit bandwidth to the individual frequency power estimates, so in practice it is still “density” (even when we might wish it weren’t).

3 Likes