Is there a code to get power spectrum corresponding to a velocity/acceleration time history?
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am working on generating seimic noise numerically. I have a velocity/acceleration time history. I want to generate power spectrum (power spectral density) compatible to the time history. Is there any code for that?
2 commentaires
Sam Chak
le 28 Mar 2022
Best if you provide the noise data and the equation for the power spectrum, so that we can investigate and analyze it.
Else, please check if the following article is helpful:
Réponses (1)
William Rose
le 28 Mar 2022
Modifié(e) : William Rose
le 29 Mar 2022
[edited: corrected spelling errors]
Yes it is possible. Estimate the spectrum of the original signal by taking the FFT or by other standard methods, such as those described in the link provided by @Sam Chak, or see the attached notes. Note that the Welch periodogram method, which is usually my first choice, would not be my first choice for a seismogram, because Welch's method chops up the signal into segments that are presumed to be similar random samples of the signal. But for a seismogram, they are not random samples of the signal, because one chunk will have the peak, and other chunks will have very little activity, and so on. Therefore I would just use the fft to estimate the amplitude spectrum.
Then create a frequency domain representation of your signal, with the ampltudes you got above, and random phases. But the phases for the "negative" frequencies must be the negative of the phases at the corresponding positive frequencies, otherwise the inverse FFT will be complex, and you want it to be real. Then take the inverse FFT of the frequency-domain version of the signal which you have cretaed. This is the output you desire. I willl provide an example of all this, in case it is not clear.
5 commentaires
William Rose
le 30 Mar 2022
I modified the script so that it reads in your file and uses the time vector in your file. I also modified the code so it works with an even or odd number of points - since your file has an odd number of points. As before, the script synthesizes three signals with the same power spectrum as the original signal, but with random phases. If you wish, adjust the script to save the signals to disk, or change the number of signals. Here is the graphical output, using your data file.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/946459/image.jpeg)
Voir également
Catégories
En savoir plus sur Spectral Measurements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!