Non-stationary ground acceleration records are simulated based on the example proposed in the paper of Guo et al.  that I have found well explained. However, the method itself is older, see e.g. [1, 2]. The present submission contains, in addition, a Matlab function to fit the non-stationary Kanai–Tajimi model to ground acceleration records.
N.B.1: the optimization toolbox is required for the fitting procedure (lsqcurvefit). However, other functions may alternatively be used. The signal processing toolbox is used here through the function filtfilt.
Any comment, question or suggestions to improve the code is warmly welcomed.
 Lin, Y. K., & Yong, Y. (1987). Evolutionary Kanai-Tajimi earthquake models. Journal of engineering mechanics, 113(8), 1119-1137.
 Rofooei, F. R., Mobarake, A., & Ahmadi, G. (2001). Generation of artificial earthquake records with a nonstationary Kanai–Tajimi model. Engineering Structures, 23(7), 827-837.
 Guo, Y., & Kareem, A. (2016). System identification through nonstationary data using Time-Frequency Blind Source Separation. Journal of Sound and Vibration, 371, 110-131.
E. Cheynet (2019). Earthquake simulation (https://www.mathworks.com/matlabcentral/fileexchange/56701-earthquake-simulation), MATLAB Central File Exchange. Retrieved .
The Matlab version you use may be incompatible with the one I used. The present submission was written with Matlab R2013b, and should be compatible with more recent version and the version R2012
hi Cheynet :
First of all thanks for answer my question i really apreciate that jejeje cd. but once again i tried to use the example.m file you joined to the submission and it still gives me the NaN values after filtering. i didnt change anything on your program i just download your file and run it.
i even took the liberty of check the filter you are using and tried with others low pass filters (elliptic and chebysheb type I) but the problem is still the same, i am even having trouble in the narginchk because it said that the function is a undefine function or method for arguments of type double, and well the "y" and "t" values are matrix.
I am working in something very similar that you are using in your program, but i am using it to calculate the vibration produce by a blasting but i have been having some problems to calculate the parameters of my acceleration records because i am been unable to fit the envelope and calculate the exact parameters. i really think with your program you solve this problem but i cant make it work properly i dont know if you would be so sweet to help me with this...
Thanks for the feedback!
If I use the example I have joined to the submission, I do not see any NaN after filtering the envelop of the acceleration records. Did you get NaN values from real ground acceleration records? If yes:
- check if your data contain any NaN values
- This may be because the characteristics of your record is significantly different from the example I have attached. Fitting procedures may be sensitive to the initial values of the parameters to be fitted. That means that for a given acceleration record, the variable "guessEnvelop" has no reason to be exactly the same as in the example I have given.
did you notice that when you try to calculate the "Y = filtfilt(d1.sosMatrix,d1.ScaleValues, abs(hilbert(y)));" in the part of "
%% Get envelop parameters" you are having some NaN values?? i think this could be for the parameters you are using at the begining of the program or what do you think it coul be the problem, i tried to use it with some of the ground aceleration records i have and it didnt work too....
Probably good. Let's check.
Added the project website
- updated description
Create scripts with code, output, and formatted text in a single executable document.