Picking n_fft for psd_welch

Hello,

I have a more conceptual question about the psd_welch analysis.

Is there a good “rule-of-thumb”, or other strategy in deciding the n_fft [and for that matter, n_overlap & n_per_seg] parameter in performing a psd?

I’m interested in looking at canonical power bands over ~30 seconds of cleaned sleep data. I used a n_fft of 2056 because it offered more power bands, and then I went back to the default 256–and I got quite different results.

Thank you,

Tom

What is your sampling rate? The n_fft gives you the frequency resolution of your PSD. If you are 100 Hz sampling rate than an n_fft at 256 means that 128 values spans from 0 to 50Hz so your frequency bin size is 50/128. The smaller is your n_fft the smoother will be your PSD estimates

HTH
Alex

That does help, thank you. My sampling rate is 500 Hz.