I'm trying to write a small Welch's PSD method in R right now, but I've had trouble finding information on how exactly the window segments are fitted to a given time series.
For instance, when the end of the time series does not fall on the end of the last window segment, what are the common ways to deal with this?
I'm assuming the time series is either truncated to perfectly fit the window segments, or zero-padded at the end so another segment can be perfectly fit. I'm interested in what the standard method is for this.
For example, lets say I have:
- A time series of 32 samples
- 5 window segments, each of 10 samples and 50% overlap
I can either, zero-pad my timeseries until it reaches 35 samples and fit an extra window segment in, or I can truncate my timeseries to 30 samples, which would perfectly fit 5 windows. Which is the proper course of action here?