Compute FRFs from the supplied CSD/PSD functions.
f=frf(gyx,gyy)
[f,c,co]=frf(gyx,gyy,'h1','silent','useinv')
FRF computes Frequency Response Functions from the supplied CSD/PSD functions. GYX is a spectral matrix of CSDs and PSDs of size NCHANxNREF where NCHAN is the number of channelsand NREF is the number of references. Each column corresponds to a different reference. The first NREF rows must contain the reference CSDs and PSDs for the references, in other words it must be Gxx. GYY is a NCHANx1 vector of PSDs of all of the reference channels in the same order as they appear in GYX. In the subscript nomenclature, X represents the inputs (references) and Y represents the responses. This function expects that Y actually contains all of the channels, references first, followed by responses.
METHOD is an optional string specifying the FRF calculation method to use. Available methods are
'H1' - Gyx / Gxx (default)
'H2' - Gyy / Gxy (single reference only)
'H3' - (H1 + H2) / 2 (single reference only)
'Hv' - Optimal scaling, used to minimize the effects of noise
In the above equations, x is the reference and y is the response.
The optional string input 'silent' suppresses any output.
If two output arguments are requested, FRF will also calculate the coherence. For single-reference input, this is the ordinary coherence, which is defined as
C = H1 ./ H2
For multiple-reference input, this corresponds to the multiple coherence, which is defined as (taken one response at a time)
C = [Gyx] [Gxx]^-1 [Gyx] / Gyy
F is an imat_fn of size NCHANxNREF containing the FRF. C is an optional output of size NCHANx1 containing the coherence (ordinary for single reference, multiple for multi-reference). CO is an optional output of size NCHANxNREF containing the ordinary coherence (for multi-reference).
The example below shows how to generate FRF from a series of time histories stored in the imat_fn T. The first 2 time histories are the reference channels.
>> gyx = csd(t(1:2),t,8192);
>> gyy = psd(t,8192);
>> [f,c] = frf(gyx,gyy);