Here is a Matlab script which calculates the H1 & H2 frequency response functions for a force and response time history pair.
It is best suited for the case of random force excitation. It uses ensemble averaging.
* * *
Here is a Matlab script which is suitable for the case of an impulse force and response pair:
* * *
See also:
* * *
– Tom Irvine