- #1
phys_student2
- 2
- 0
I am trying to implement what's called the "second spectrum". Basically, you do this:
1. Take a time series of length [itex]N[/itex].
2. Divide it into [itex]m[/itex] segment, each of length [itex]N'=N/m[/itex].
3. For each segment [itex]m[/itex], do a Fourier Transform. The result is the 'first spectrum',[itex]S_i^{(1)}(f_1), i=1,...,m[/itex]
4. Divide each spectrum into [itex]n[/itex] octaves, an octave starts at [itex]f_L=f_0 \times 2^p[/itex] and ends at [itex]f_H=f_0 \times 2^{p+1}[/itex], where [itex]p=0,1,2, etc[/itex], and [itex]f_0[/itex] is the lowest frequency in [itex]S_i^{(1)}(f_1)[/itex]. For [itex]f_0 = 1[/itex] Hz, The octaves will be like: 1-2 Hz, 2-4 Hz, 4-8 Hz, 8-16 Hz, etc.
5. For each octave in each spectrum, sum all spectrum values in that octave.
6. Construct a time-series for each octave. There will be [itex]n[/itex] time series each of length [itex]m[/itex].
7. Take the Fourier Transform of each time series. This is the second spectrum, [itex]S_n^{(2)}(f_2)[/itex]
I have already implemented this algorithm (in c++), but I have a question about step 7. I implemented a Welch periodogram method for doing an FFT-based Power Spectral Density. This method chops the signal into segments of length L with overlapping D. Then it Fourier Transform each segment, and the final answer is the average of these transforms. The larger the number of segments, the lower the variance obtained.
But in step 7, I typically have a time series of length 32, too short to divide into segments. Should I do the PSD with one segment being the whole data, or I still have to segment it? In that case the resulting second spectrum will have too few data points to have any meaning.
(A version of this question appeared in Stack Exchange, but I got no answers)
1. Take a time series of length [itex]N[/itex].
2. Divide it into [itex]m[/itex] segment, each of length [itex]N'=N/m[/itex].
3. For each segment [itex]m[/itex], do a Fourier Transform. The result is the 'first spectrum',[itex]S_i^{(1)}(f_1), i=1,...,m[/itex]
4. Divide each spectrum into [itex]n[/itex] octaves, an octave starts at [itex]f_L=f_0 \times 2^p[/itex] and ends at [itex]f_H=f_0 \times 2^{p+1}[/itex], where [itex]p=0,1,2, etc[/itex], and [itex]f_0[/itex] is the lowest frequency in [itex]S_i^{(1)}(f_1)[/itex]. For [itex]f_0 = 1[/itex] Hz, The octaves will be like: 1-2 Hz, 2-4 Hz, 4-8 Hz, 8-16 Hz, etc.
5. For each octave in each spectrum, sum all spectrum values in that octave.
6. Construct a time-series for each octave. There will be [itex]n[/itex] time series each of length [itex]m[/itex].
7. Take the Fourier Transform of each time series. This is the second spectrum, [itex]S_n^{(2)}(f_2)[/itex]
I have already implemented this algorithm (in c++), but I have a question about step 7. I implemented a Welch periodogram method for doing an FFT-based Power Spectral Density. This method chops the signal into segments of length L with overlapping D. Then it Fourier Transform each segment, and the final answer is the average of these transforms. The larger the number of segments, the lower the variance obtained.
But in step 7, I typically have a time series of length 32, too short to divide into segments. Should I do the PSD with one segment being the whole data, or I still have to segment it? In that case the resulting second spectrum will have too few data points to have any meaning.
(A version of this question appeared in Stack Exchange, but I got no answers)