-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
In the section on IQ sampling there is the following code for calculating the PSD and it follows with a note about optionally applying a window.
Shouldn't there be a window correction factor applied to account for the reduction in amplitude resulting from the window?
I've seen a number of discussions on window correction factors and I'm unsure which applies in this case (coherent gain or equivalent noise bandwidth). E.g. dividing by the sum of the square of the window, the square of the sum, of the mean, etc.
I couldn't find any reference to it in this section, unless I missed it.
Fs = 1e6 # lets say we sampled at 1 MHz
# assume x contains your array of IQ samples
N = 1024
x = x[0:N] # we will only take the FFT of the first 1024 samples, see text below
x = x * np.hamming(len(x)) # apply a Hamming window
PSD = np.abs(np.fft.fft(x))**2 / (N*Fs)
PSD_log = 10.0*np.log10(PSD)
PSD_shifted = np.fft.fftshift(PSD_log)
Metadata
Metadata
Assignees
Labels
No labels