3
votes

Does anyone know if it is possible to find a power spectral density of a signal with gaps in it. For example (in matlab syntax cause that is what I'm familiar with)

ta=1:1000; 
tb=1200:3000;

t=[ta tb];    % this is the timebase
signal=randn(size(t));  this is a signal

figure(101)

plot(t,signal,'.')

I'd like to be able to determine frequencies on a longer time base that just the individual sections of data. Obviously I could just take the PSD of individual sections but that will limit the lowest frequency. I could interpolate the data, but this would colour the PSD.

Any thoughts would be much appreciated.

3
What you call "gaps" is actually padded with zeros by Matlab, and zero is a legitimate value for a signal, so as far as the PSD is concerned, there are no gaps, just a signal with occasional sections of zeros. Gaps in the signal are actually a missing information, and replacing the missing information with zeros is arbitrary as any other value, as long as you don't have any model of the signal. You could try to model the signal in the spectral domain, and use the model to interpolate the missing information.Itamar Katz
Actually, for the plot produced by the code above, the region (t>1000 &t<1200) there is no data. I've not replaced it with zeros or other data. You are right in that I could insert some arbitrary data which has a similar spectral content to the data either side, but I worry that this will affect the PSD of the total data set.mor22
when you tell Matlab something like a[1 2 4] = [1 1 1]; Matlab pads the 3rd element (whose index is missing) with a zero.Itamar Katz
@Itamar Katz: I haven't done that. t is the concatenation of the two sets of time indices.mor22
You're right, I was misreading the code. Too many hours at work...Itamar Katz

3 Answers

6
votes

The Lomb-Scargle periodogram algorithm is usually used to perform analysis on unevenly spaced data (sampled at arbitrary time points) or when a proportion of the data is missing.

Here's a couple of MATLAB implementations:

0
votes

I found this Non Uniform FFT but I'm not sure that its exactly what I need as it might really be for data that is mostly sampled on an uneven time base, rather than evenly spaced data with significant gaps. I'll give it a go!

0
votes

Leaving out segments of the Fourier basis vectors results in exactly the same FT, thus PSD, as using the complete basis, but multiplying by zeros within a zero padding in any signal "gaps".