normalized-spectrogram

版本 1.2 (14.2 KB) 作者: Pablo P
Normalized spectrogram of a seismic acceleration
80.0 次下载
更新时间 2019/4/2

Normalized spectrogram

Normalized spectrogram

Normalized spectrogram of a seismic acceleration


Normalized spectrogram to seismic acceleration written in Matlab. The algorithm used is the following:

1. Baseline correction
2. Tuckey window is applied with r=5%.
3. FFT on window signal.
4. Spectrum is smoothed by 5 points halfwidth moving average.
5. Each element of spectrum is normalized by maximum spectral amplitude.

The function

The normalized spectrogram function is defined by:

[matrix, matrix_t, matrix_f] = norm_spectrogram(t, acc)

Where:

Variable Description
t Time of the seismic accelerogram
acc Acceleration (g) of the seismic accelerogram

This function returns a matrix in where columns refer to mean window time (matrix_t), rows are the frequency of the spectrogram (matrix_f) and the value of the matrix are the amplitude of the spectrogram from each time-window on each frequency.

To print matrix you should use:

plot_norm_matrix(m, mt, mf, t, acc, regname)

Where:

Variable Description
m Normalized matrix
mt Time array from matrix
mf Frequency array from matrix
t Time of the seismic data
acc Acceleration of seismic data
regname Name of the seismic data (plot title)

Example

Lets suppose that a seismic registry is stored on data/CNV_APED_201604162359_N_100.txt, the file structure is like:

0.000000 -6.329500
0.010000 2.539600
0.020000 12.822900
0.030000 9.435300
0.040000 -5.397100
0.050000 -14.233900
...

Then:

% Load the data
data = load('data/CNV_APED_201604162359_N_100.txt');

% Set time and acceleration array
t = data(:, 1);
acc = data(:, 2) ./ 980; % Convert from cm/s2 to g

After that we will use norm_spectrogram function

[m, mt, mf] = norm_spectrogram(t, acc);

Then plot:

plot_norm_matrix(m, mt, mf, t, acc, 'APED 2016/04/16 23:59 N-S');

Obtaining:

License

This project is licensed under GPLv2 [https://www.gnu.org/licenses/gpl-2.0.html]

Author

Pablo Pizarro R. | 2017 - 2019

引用格式

Pablo P (2024). normalized-spectrogram (https://github.com/ppizarror/normalized-spectrogram/releases/tag/1.2), GitHub. 检索来源 .

MATLAB 版本兼容性
创建方式 R2022a
兼容任何版本
平台兼容性
Windows macOS Linux
标签 添加标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.2

1.1.0.0

See release notes for this release on GitHub: https://github.com/ppizarror/normalized-spectrogram/releases/tag/1.1

1.0.0.0

See release notes for this release on GitHub: https://github.com/ppizarror/normalized-spectrogram/releases/tag/1.0

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库