# Algorithm to estimate coherence when measuring a transfer function with a swept sine

I use a swept sine to measure a transfer function, multiplying the reponse by the in phase and quadrature excitation to get a complex response at each frequency. Can you suggest an enhancement to this technique to estimate coherence as well to give an estimate of measurement quality, especially at higher frequencies where the response is small.

• Are you talking about this definition of coherence? [Coherence](en.wikipedia.org/wiki/Coherence_(signal_processing) – Jacob Oct 23 '12 at 15:31
• Yes, but I want to calculate it or estimate it on the fly, while the swept sine (or really stepped sine, so I can integrate over a number of cycles) is running. – Nigel Davies Oct 23 '12 at 15:47

## 1 Answer

For each frequency, divide the measurement time into chunks. For each chunk, do your estimation of the amplitude at that frequency in both the input and output channels. Then compute the coherence for this ensemble of measurements at each frequency.

For example, if you measure at each frequency for Ncyc cycles, then divide these into Navg measurements each of Ncyc/Navg cycles.

A nice reference on this subject is Bendat and Piersol.