'Impose frequencies for powerspectrum (or spectrograms) using standart python packages (scipy, numpy)

I am trying to run power spectral analyses on EEG data for 2 second periods, at 30Kz, using scipy or numpy. I can do basic spectral analyses using, for example,

ff, pxx = scipy.signal.periodogram(data, fs=SF)

However, I don't care about high frequencies (above 40Hz - yes I can decimate the data but it does not solve my issue) and I want a good frequency resolution (like a 0.1Hz between ff values) this is easy to do with a lot of matlab codes, but I can't find any easy python stuff using scipy, numpy or matplotlib. Something like:

ff, pxx = nicepackage.periodogram(data, sf=SF, freqs=np.arange[0.1:0.1:30])

I am trying to play with the number of FFT points but it gets me nowhere.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source