%
%  generate_time_history_wavelet_table_q.m  ver 1.1  by Tom Irvine
%
function[accel]=generate_time_history_wavelet_table_q(f,amp,~,td,t,...
                                         wavelet_low,wavelet_up,alpha,beta)


nt = length(t);
last_wavelet = length(f);

ia = wavelet_low(1:last_wavelet);
ib = wavelet_up(1:last_wavelet);

accel = zeros(nt,1);

for i = 1:last_wavelet
    idx = ia(i):ib(i);
    tx = t(idx) - td(i);
    sa = sin(alpha(i) * tx);
    sb = sin(beta(i) * tx);

    accel(idx) = accel(idx) + (amp(i) * (sa .* sb))';
end