0

I woudlike to do an PSD (base on Welch's average) of my sdr module in python. I use this function :

matplotlib.mlab.psd(x, NFFT=None, Fs=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None)

Source

Actually my problem is about how to choose the gap between each value ?

For example, I want to have 10 values between 105 and 106. So I'll have 10 values like this :

105.1, 105.2 105.3 105.4 105.5 105.6 105.7 105.8 105.9 106

Acutally I did this :

psd(samples, NFFT=10, Fs=sdr.sample_rate/1e6, Fc=sdr.center_freq)

My radio module have 1.024 MHz sample rate but the gap between each value is not regular like this : Fc=105.3 ===> 105.300001 105.300003.....

Source: https://github.com/roger-/pyrtlsdr

Thanks.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
azzerty2017
  • 43
  • 1
  • 1
  • 9

1 Answers1

0

mlab.psd() uses an algorithm that does not handle irregularly spaced time intervals. You could either round or interpolate to evenly spaced time points. Have a look at this answer about dealing with this problem.

grg rsr
  • 558
  • 5
  • 13