I am working with data from a TeraFlash THz Spectrometer from Toptica, which gives me the pulse in the time domain and the spectrum in the frequency domain
I have been experimenting with the FFT to get to the spectrum myself and I see some discrepancies compared to the spectrum from the software. The manufacturer told me that they use an adapted blackman window that only changes the first pulse sample and the last two pulse samples, so I assume that everything in-between will be weighted with 1 and only the beginning and end will have a smooth transition to 0. Apparently, this is done such that the pulse will not be altered by the window if it is not centered.
In the attached plot I have included the window (adapted blackman window) as well as the pulse and the two spectra (the software's and mine). I am particularly interested in the absorption lines in the spectrum that are not identical between the two calculation methods...
As I am new to DSP, I am not sure if this is a significant difference or if both spectra should suffice. In this setup, only the absorption lines air (mainly water) are visible, but for further measurements I am interested in the absorption lines of different materials.
EDIT: the other window functions shown in the legend of the plot result in even more discrepancies than the adapted blackman window, thus I chose not to show them.
I used numpy FFT calculation:
def get_fft(t, p, padding=True):
if padding:
t, p = zero_padding(t, p) # apply zero padding to get 100001 datapoints on the spectrum
p = p * blackman(len(t)) # apply blackman window
SAMPLE_RATE = len(t) / (t[-1] - t[0]) * 1e12
N = len(p)
a = np.abs(rfft(p))
f = rfftfreq(N, 1 / SAMPLE_RATE) / 1e12
return f, a

The software has no option to choose between two different windows, it has only the "modified blackman window" implemented. The different windows in the legend of the plot are just my implementations in python (np.blackman(n), np.hamming(n) etc...)
– lazerlini Aug 19 '22 at 11:18Please edit out the second plot showing the hamming window, it has no value here (my bad!) and replace the code portion with the Blackman window to avoid confusing others ;)
– Jdip Aug 19 '22 at 11:29