# Smoothing a power spectrum

My question is regarding how one could/should smooth a rather noisy power spectrum obtained from measurements. There are various methods one can use (a moving average, binning, etc) and I am not sure what the correct approach would be, given the situation I will describe.

Although at first sight it might sound like I am asking about what kind of periodogram to use (see for example this question with excellent answers), I think my situation might be a bit different. What I have is a bunch of complex valued autocorrelation functions (ACF): $n$ datasets of length $m = 8192$, centered at $t = 0$, taken with a sampling rate of 1 nanosecond (so 1 GHz sampling rate).

While the specifics are not too relevant to the question, they can also not be changed; the data is obtained using an FPGA that receives a complex value every nanosecond, and it internally calculates the autocorrelation function using a bunch of steps involving DFT's implemented in the binary hardware.

So the data I have I am essentially stuck with. Given this set of ACFs, I'd now like to get their power spectra, which is of course just the Fourier transform. Here is an example:

There are a few things to see. First, there are two peaks between -100 and 0 MHz. These are the main objects of interest; they change their width and height in each dataset, and I'd like to integrate them to see how their area changes. As they are now they are rather noisy, and I think they would benefit from smoothing.

The second thing is the major peak between 100 and 200 MHz; this peak is always there (always at the exact same frequency with this resolution), and it should be kept. That means that it shouldn't be smoothed, nor should its neighbours take it into account when smoothing. I suppose one solution is just to take it out, smooth, and put it back in.

Finally there is some noise background that varies from about 0 to 0.002. This I am not interested in; it doesn't have to go away completely, but it should still be flattened out so that I can see it as a sort of static background.

So, taking this all into account, I am looking for some advice on what to do. A simple approach would be binning; splitting the data up into $k$ segments of length $l$ and taking the central moment of each segment as my new dataset. Of course it reduces the number of points. Another alternative is using a moving average, which replaces each datapoint by its r-range average. And then there are a million more smoothing methods; I just don't know what is more suitable.

And I suppose this is the main question. Given that I have a dataset that looks like shown above, with the features I described, how should I go about narrowing down what type of smoothing method is most suited? The main deal, as I mentioned before, is finding the area of the two peaks between -100 and 0. Also making the data look a bit more pleasant is not unimportant. The moving average does all this, but it feels so.. primitive.

For reference, the dataset (as comma seperated values) can be found here. Note that this is already the PSD; the Fourier transform of my original datasets.

• Did you have a complex input signal or is the frequency axis of the plot wrong, because normally it should be symmetric around 0 Hz. And to have you tried Welch's method? – fibonatic Jul 26 '16 at 14:32
• It is a complex input signal yes. I thought I wrote this, but it seems like I didn't. As for Welch's method, isn't that for when you have a time trace, not an ACF? – user129412 Jul 26 '16 at 15:12
• You are correct I skipped over that part. How much does the width and height of the two peaks change between the different ACF's? Is it possible that it is caused by noise or small variations of the measurement setup? And how many ACF's do you have? Because I might try to calculate the average at each frequency. – fibonatic Jul 26 '16 at 16:00
• So, as for the two peaks. It is actually rather intricate; they are a feature of some physical process we are measuring. Without going into the specifics, atoms are absorbing light and then re-emitting it at different frequencies (incoherent emission). We are changing some parameters and seeing how the incoherent emission changes, and we want to quantify that. They change substantially; one dies out and the other becomes about twice as big and wide. As for the ACF, we have one for each parameter setting, but they are already averaged 64 million times. – user129412 Jul 26 '16 at 16:18
• Didn't fit into the last comment, but there is definitely a noise background; this is this 0.002 that you see. We're already taking a lot of measures to reduce this as far as possible (the 64M averages, and also subtracting the background without any signal applied) – user129412 Jul 26 '16 at 16:19