# Coherence of a single function given a single frequency

I have a signal sampled from a hardware, s. I would like to compute the coherence of the sampled signal given a single frequency, f. Below are the approaches I can think of.

1. Base on f generate a synthetic signal and compute the coherence of s and the synthetic signal.
2. Use SNR similar approach with frequency range [f - a, f + a] to compute the SNR of s as its coherence level, where a is a threshold.

I know both approach are not the right way to do it. There are just the possible solutions come to my mind. I would like to know how to do it right.

• What exactly do you mean by "coherence given a single frequency"? May 27 '13 at 7:24
• Sorry for not giving enough info. In matlab we can compute coherence of 2 signals with mscohere. However in my case I only have 1 signal, s. But I'm given a desired signal frequency f for ideal case. I would like to compute how close the signal s with the ideal case. Perhaps coherence is not the right word here. May 27 '13 at 8:50
• What do you know about $s$? Is it a pure sinusoid?
– Deve
May 27 '13 at 12:25
• s is not a pure sinusoid, it can be any signal polluted by noise. The objective is to compute the level of frequency f with a threshold, a in signal s. If all frequency in s fall into [f - a, f + a] then it should give 1.0 May 27 '13 at 13:06