%
% Basilar membrane demonstration movie
%
% This is just a simple illustration on how travelling waves
% form on the basilar membrane in the inner ear for a sequence of 
% three sinusoids.

clear model;close all;

% This is the model
model.fs=16000;
model.cochlea.fb.file='gt128_bmdemo';

% A sequence of three sinusoids
s=[tone(600,500) tone(2000,500) tone(5000,500)];
A=AudMod(s,model);

n=150;
x=linspace(0,1,128);
M = moviein(n);
       for j=1:n
      plot(x,A(j*10-9,:));axis([0 1 -0.6 0.6]);
      xlabel('Basilar membrane');ylabel('Deviation');
          M(:,j) = getframe;
       end
clear A;
movie(M,12,30)
clear all;