Earthquake Response Spectrum from an Accelerogram
Operator: Abdulla Al Fahad. How tools are built and checked
A response spectrum answers one question about a ground motion: how hard would it shake a simple structure of a given period? You feed the accelerogram to a family of single-degree-of-freedom oscillators, from stiff ones at 0.02 s to flexible ones at 10 s, and record each one's peak response. Plotted against period, those peaks are the curve that design codes and hazard studies work with.
This page integrates each oscillator with the Newmark average-acceleration method, stepping at no more than a two-hundredth of its period, and gives the peak relative displacement SD, the pseudo-velocity PSV, the pseudo-acceleration PSA and the true peak absolute acceleration SA for up to six damping ratios.
Around the spectrum it computes the intensity measures an engineer asks for next: PGA, PGV and PGD, Arias intensity and the Husid plot, the 5-75% and 5-95% significant durations, cumulative absolute velocity, bracketed duration, Housner intensity and the Fourier amplitude spectrum. With a second horizontal component it adds RotD50 and RotD100.
Key features
- Spectra of SD, PSV, PSA and absolute SA for up to six damping ratios, over 5 to 200 log-spaced periods between 0.005 s and 100 s (very long records, or two components with RotD, allow fewer periods because the total integration work is capped)
- RotD50 and RotD100 of PSA from two orthogonal horizontal components, searched at 3-degree steps
- Baseline correction by removing the mean or a least-squares line, quadratic or cubic, and an optional zero-phase Butterworth band-pass
- PGA, PGV, PGD, Arias intensity, D5-75, D5-95, CAV, RMS, bracketed duration over 0.05 g, Housner intensity, time of the peak, Husid plot
- Fourier amplitude spectrum on log-log axes, and CSV or XLSX export that records the units, baseline, filter and integrator used
Record layouts, processing steps and the intensity measures
Three layouts are read. A header with NPTS= and DT= followed by free-format numbers, the layout of PEER-style AT2 text files, gives the step directly. A table of time and acceleration, from a CSV or pasted text, gives the step from its first and last time and is refused if any row departs from it by more than 1%. A single column of accelerations needs the time step typed in.
Choose the units of the numbers, g, m/s² or cm/s², and everything is converted to SI inside. The record must have between 100 and 200,000 samples. A second record for RotD must have the same length and step as the first.
COSMOS V1 and V2 and CESMD files are not read as such. Cut out the acceleration column of those files, or convert them to a time and acceleration table first. No ground-motion records ship with this page; the example is synthetic.
The result of baseline correction and filtering is what the spectra use. Velocity and displacement are the trapezoid integrals of that corrected acceleration, so PGV and PGD depend on the processing choice, and the export lists the choice.
How it works
Each oscillator has unit mass, stiffness (2π/T)² and damping 2ζ(2π/T), driven by minus the ground acceleration. The record is interpolated linearly between samples and the equation is advanced by the incremental Newmark average-acceleration scheme, which is unconditionally stable. The step is shortened so that no sub-step exceeds T/200, and every sub-step is checked for a new peak so that a maximum between two samples is not missed.
PSA is the squared natural frequency times the peak relative displacement, and PSV the natural frequency times it. The absolute acceleration SA is tracked separately from the oscillator's acceleration plus the ground acceleration. RotD rotates the displacement histories of the two components, finds the peak over time at each angle from 0 to 177 degrees, and takes the median (RotD50) and the maximum (RotD100) over angles.
Common use cases
- A structural engineer checks a record against a design spectrum: 5% damped PSA of 0.87 g near 0.38 s from the page set against the code curve at the same period.
- A student compares 2% and 5% damping and sees the peak near 0.38 s drop from 1.42 g to 0.87 g, a ratio of 0.61.
- A geotechnical engineer wants the shaking duration: D5-75 of 10.94 s and D5-95 of 14.37 s come straight from the Husid plot of the corrected record.
How to use this tool
- Set the units and, for a single-column file, the time step, then drop the record or load the example.
- Choose the baseline correction and, if you want one, the band-pass corners.
- List the damping ratios in percent, set the period range and the number of periods, and compute.
- Read the intensity measures and the spectra, and add a second component to see RotD50 and RotD100.
Example
The page's example: two synthetic 30 s components at 100 samples per second (peak 0.3 g and 0.22 g), linear baseline, band-pass 0.1 to 25 Hz, 5% damping
Units g. Baseline: remove a straight line. Band-pass: Butterworth order 2, zero-phase. Periods 0.02 to 10 s.Component 1 results
PGA 0.282 g at 5.21 s, PGV 52.87 cm/s, PGD 39.90 cm, Arias intensity 1.862 m/s, D5-95 14.37 s, CAV 1.277 g·s
PSA at 5% damping peaks at 0.866 g near 0.38 s; it is 0.537 g at 0.097 s, 0.300 g at 0.985 s and 0.126 g at 2.06 s
RotD50 / RotD100 at 0.524 s: 0.507 g / 0.630 g, against 0.600 g for component 1 aloneTips for best results
- Compare the PSA at the shortest period with the PGA. A well-formed record has SA at 0.02 s equal to the PGA, and in the example the ratio is 1.0001.
- For a record with a 0.005 s step, a period of 0.02 s needs 50 sub-steps per sample, so very long records with many short periods take longer. The page refuses jobs that would need more than 300 million steps.
- Use PSV against period on log axes to see where a record is rich: the flat part is the velocity-controlled range.
- When a record has a long, quiet tail, the D5-95 duration is a better measure than the bracketed duration, which is set by the first and last 0.05 g exceedance.
- Check the corrected velocity and displacement plots. A displacement that drifts away from zero at the end means the baseline correction was too weak for the long-period spectrum.
Common pitfalls
Long-period values depend on the processing. In the example, moving the low corner of the band-pass from 0.05 Hz to 0.2 Hz changes SD at a 4 s period from 34.1 cm to 19.7 cm and PGD from 355 cm to 12.2 cm, so quote the corners with the result.
RotD uses the displacement histories at the sample times, not at the integration sub-steps, so with one component and a zero second component it read 0.3% to 0.4% below the single-component spectrum at periods of 0.03 to 0.1 s on a 0.01 s record.
PGV and PGD come from trapezoid integration, not from a velocity or displacement trace that the instrument recorded. An unfiltered synthetic record drifted to a PGD of 322 cm in testing, which is why the example uses a band-pass.
Common errors and how to fix them
- The time column is not evenly spaced (row 26). Resample the record to a constant step first.
- Interpolate the record to a constant step before loading it; the integrator assumes one step for the whole record.
- A single-column record needs a time step: enter dt in seconds.
- Type the sampling interval, for example 0.01 for 100 samples per second.
- The band-pass corners must satisfy 0 < low < high < 50.00 Hz (half the sampling rate).
- Lower the high corner below half the sampling rate, or leave the filter off.
Best practices
- Record the baseline and filter choices with every spectrum, and use the XLSX export, which keeps them on their own sheet.
- Compute at 5% damping first and add other dampings only when you need them; each damping ratio repeats the whole integration.
- Check the spectrum at a period much shorter than the structure and at one much longer, against PGA and PGD, before using the middle of the curve.
- Keep the units of the input honest: a record in cm/s² read as g gives spectra a thousand times too large.
Reading the intensity measures
Arias intensity is π/(2g) times the integral of the squared acceleration, in metres per second, and measures the total energy delivered; the Husid plot is its running total as a fraction of the end value. D5-75 and D5-95 are the times between 5% and 75%, and between 5% and 95%, of that total. CAV is the integral of the absolute acceleration. Housner intensity is the integral of the 5% damped PSV from 0.1 to 2.5 s, computed on its own grid of 49 periods.
Why the integrator takes small steps
The average-acceleration method is stable for any step, but it lengthens the period of the oscillator by about (ωΔt)²/12. At T/200 that is a lengthening of 0.008% per cycle, which keeps the spectral peaks in place. A record with a 0.01 s step and a 0.02 s period would be far too coarse without the sub-steps, because the oscillator would see two samples per cycle.
When a second component helps
A single horizontal component gives the response in one direction. RotD50 is the median over all orientations and RotD100 the largest, so with two components the page shows how much stronger the shaking is in the worst direction. In the example the ratio of RotD100 to RotD50 at 0.524 s is 1.24.
Frequently asked questions
Is the integrator accurate enough?
The integrator was checked against closed forms. For an undamped oscillator under a sine of 1 m/s² at half its natural frequency, the displacement matches the analytic solution to 0.016% of its peak at a 1 ms step, and to 0.40% at 5 ms. For 5% damping under a long sine, SD and absolute acceleration match the steady-state transmissibility within 0.05% at frequency ratios from 0.5 to 1.5. The PSA at 0.02 s equals the PGA to 0.01%, and a stiff-to-flexible check with a Gaussian-derivative pulse gives SD equal to the peak ground displacement within 0.03% at a 2,000 s period.
Why is the closed-form check 0.40% off at a 5 ms step but 0.016% at 1 ms?
The test oscillator had a 1 s period, so a 5 ms record step is T/200, the integrator's own limit, and the period error of the method builds up over 20 undamped cycles. With a damped oscillator or a few cycles of response the error is smaller.
Does it match PEER records or SeismoSignal?
It follows the same definitions, but it was not compared against those programs or records. No PEER or CESMD data is included, so run your own record and compare.