% This program takes the output from membrane.m or membrane2.m
% and produces a time series at a fixed point on the interior
% of the membrane. The time series is then Fourier analyzed
% to determine which frequencies are excited by the the impulse force.

% Sampling - In order to get the frequencies to show up properly in
%     the periodogram, one needs to sample at least at twice
%     the maximum frequency. Thus, fs = 1/dt = 2(f_max), where
%     dt = T/N for T = tmax (duration time in membrane.m or membrane2.m) & 
%      N = Nt = number of time steps (in memrecwv.m or memcirwv.m)
% For example - I set T = 5 and Nt = 5000. This gives dt = 0.001 s and
%     fs = 1/dt = 1000 Hz. So, fmax = 500 Hz. 
% However, one might want to see up to 1000 Hz, thus dt should be cut 
% in half, say set T = 2.5 s or Nt = 10000.

s=size(u);
N=s(3);
[c,j0]=max(max(abs(u(:,:,2))));
[c,i0]=max(abs(u(:,j0,2)));
[i0,j0]
for j=1:N
    Y(j)=u(i0,j0,j);
end
plot(t,Y)
figure(2)
fanalf(Y-mean(Y),max(t))
figure(1)