DSPRelated.com
Forums

Transfer function and Coherence using Matlab

Started by kool_ajith February 23, 2007

Hi All,

1) I have a windows application created using .NET, C# to be specific.

2) I have two waveforms X and Y. X is input waveform and Y is output. X
and Y are nothing but 1048 samples of complex data in an Array.

3) I have FFT algorithm with me.

4) Now can anyone help me calculate the Transfer function and Coherence
using Matlab. I think Matlab has some function call to calculate this
Transfer function and Coherence.


If there are any other suggestions ... please specify.
Any suggestions are welcome.

Thanks and regards,
Ajith

kool_ajith wrote:
> Hi All, > > 1) I have a windows application created using .NET, C# to be specific. > > 2) I have two waveforms X and Y. X is input waveform and Y is output. X > and Y are nothing but 1048 samples of complex data in an Array. > > 3) I have FFT algorithm with me. > > 4) Now can anyone help me calculate the Transfer function and Coherence > using Matlab. I think Matlab has some function call to calculate this > Transfer function and Coherence. > > > If there are any other suggestions ... please specify. > Any suggestions are welcome. > > Thanks and regards, > Ajith
The Tf is th ratio of the two spectra ie output/input. You need the magnitude rather than power spectra though if you convert to dB it makes no difference - one takes 10Log(power ratio) and the othe.r 20 log. Why do you need Matlab? F.
On Feb 23, 3:36 pm, "kool_ajith" <kool.aj...@gmail.com> wrote:
> Hi All, > > 1) I have a windows application created using .NET, C# to be specific. > > 2) I have two waveforms X and Y. X is input waveform and Y is output. X > and Y are nothing but 1048 samples of complex data in an Array. > > 3) I have FFT algorithm with me. > > 4) Now can anyone help me calculate the Transfer function and Coherence > using Matlab. I think Matlab has some function call to calculate this > Transfer function and Coherence. > > If there are any other suggestions ... please specify. > Any suggestions are welcome. > > Thanks and regards, > Ajith
The transfer function is Pxy/Pxx. The coherence function is |Pxy|^2/(Pxx*Pyy). Check out the Matlab functions 'cohere' and 'tfe' in the SP Toolbox. If you don't have the code, you can look at the references online and implement the algorithms yourself. John
>The transfer function is Pxy/Pxx. > >The coherence function is |Pxy|^2/(Pxx*Pyy). > >Check out the Matlab functions 'cohere' and 'tfe' in the SP Toolbox. >If you don't have the code, you can look at the references online and >implement the algorithms yourself. > >John
I have implemented the above said formula in C#. I just wanted to verify that the output from my formula matches the output of from the Matlab. Can to specify which references online are you referring to?? Can you also tell me ... if - I have waveform X and WaveformY. - WaveformX is the input waveform and WaveformY is the output waveform. - First I apply FFT on both the waveforms to convert the time domain waveform to frequency domain. - The output of the FFT is in rectangular format. Consider Input WaveformX : a+ib Output WaveformY : c+id - Now according to the formula you have mentioned The transfer function is Pxy/Pxx. The coherence function is |Pxy|^2/(Pxx*Pyy). What will be the formula for Transfer function when substituting 'a+ib' + 'c+id' for Pxy/Pxx?? Similarly what will be for Coherence? Please help me with this... Thanks and Regards, Ajith
kool_ajith wrote:
>> The transfer function is Pxy/Pxx. >> >> The coherence function is |Pxy|^2/(Pxx*Pyy). >> >> Check out the Matlab functions 'cohere' and 'tfe' in the SP Toolbox. >> If you don't have the code, you can look at the references online and >> implement the algorithms yourself. >> >> John > > I have implemented the above said formula in C#. I just wanted to verify > that the output from my formula matches the output of from the Matlab. > > Can to specify which references online are you referring to?? > > Can you also tell me ... if > - I have waveform X and WaveformY. > - WaveformX is the input waveform and WaveformY is the output waveform. > - First I apply FFT on both the waveforms to convert the time domain > waveform to frequency domain. > - The output of the FFT is in rectangular format. Consider > Input WaveformX : a+ib > Output WaveformY : c+id > > - Now according to the formula you have mentioned > The transfer function is Pxy/Pxx. > The coherence function is |Pxy|^2/(Pxx*Pyy). > > > What will be the formula for Transfer function when substituting 'a+ib' + > 'c+id' for Pxy/Pxx?? > > Similarly what will be for Coherence? > > Please help me with this... > > Thanks and Regards, > Ajith >
I was referring to the online documentation available free from Mathworks. John