function [spec]=powspec(seis,dt); % [SPEC]=POWSPEC(SEIS,DT) calculates and plots the power spectrum of % seismogram(s) in SEIS. DT is the sample interval and PSPEC is the % power spectrum. If SEIS is a single seismogram, then a log-log plot % of the power spectrum is displayed. If SEIS is a matrix, then the % spectrum is calculated for each line of SEIS, but no plot is % produced. fftseis=fft(seis')'; spec=(real(fftseis).^2+imag(fftseis).^2).^.5; if min(size(spec))==1 figure(11) lspec=length(spec); lhspec=round(lspec/2); frequ=1/dt; nyfrequ=frequ/2; minfrequ=1/(lspec*dt); loglog(minfrequ:nyfrequ/lhspec:nyfrequ,spec(1:lhspec)) end