Phase-averaging a cyclic signal is defined as averaging the signal over one full cycle. It can be tricky if cycles have varying length (for example the position of a fan blade as it slows down after switchoff.)
When studying the noise generated by an oscillating object, it is interesting to analyze the phase-averaged spectrogram of the radiated noise.
This code computes the phase-average of the spectrogram of a cyclic noise, even if the cycles have varying duration.
Method 1: If the cycles all have a close duration (function PhaseAveraged_spectrogram_MeanCycleLength).
- Detect the index corresponding to the beginning of every cycles
- Compute the spectrogram of the signal on each cycle
- Average all the spectra
Method 2: If the cycles have different duration, the code use the TSA (Time-Synchronous Averaging) algorithm (function PhaseAveraged_spectrogram_TSA), implemented in the pyTSA function:
- Detect the index corresponding to the beginning of every cycles
- Compute the spectrogram of the entire signal.
- Thanks to a loop on frequencies, compute the phase-averaging of the signal for each frequency of the spectrogram separatly, using the time-domain or the frequency-domain method:
Time-domain method:
- Divide the signal into segments corresponding to the different cycles
- Interpolate the signals in each segment on the same number of sample
- Compute the average of all the resampled segments
Frequency-domain method:
- Divide the signal into segments corresponding to the different cycles
- Compute the fft of each segment
- Truncate the results on each segment so that all fft have the same length as the one of the shortest cycle
- Average all the spectra
- Compute the inverse fft to obtain the phase-averaged signal in the time domain.
The code PhaseAveraged_Spectrogram_example.py presents an example of use of these two methods, to study the noise generetad by an oscillating airfoil in a turbulent flow.
Bechhoefer, Eric, and Michael Kingsley (2009). "A Review of Time-Synchronous Average Algorithms." Proceedings of the Annual Conference of the Prognostics and Health Management Society, San Diego, CA, September-October.
Raus, D., Cotté, B., Monchaux, R., Sicard, L., Jondeau, E., Souchotte, P., & Roger, M. (2021). Experimental characterization of the noise generated by an airfoil oscillating above stall. In AIAA AVIATION 2021 FORUM (p. 2291).
Raus, D., Cotté, B., Monchaux, R., Jondeau, E., Souchotte, P., & Roger, M. (2022). Experimental study of the dynamic stall noise on an oscillating airfoil. Journal of Sound and Vibration, 537, 117144.