% uph2 (microphonics2)
% can we remove uphonics digitally?
%

clear
hold off

load shapes2
I=size(shapes2);
%determine suitable high pass filter

S=16000;           %max number of samples for trapezoidal filter
%x=zeros(I(1,1),S/2);
%x=[x ones(I(1,1),S/2)];
T=10e-9*(1:I(1,1)*S)*1e3;    %uphonics at 1KHz
uph=0.1*sin(T*2*pi);    

[a,b,c,d]=butter(1,10e-9*1e4*pi,'high')

w=pi*(.00001:.01:1);
[mag,phase]=dbode(a,b,c,d,1,w);

y=dlsim(a,b,c,d,uph);

plot(T',uph','g',T',y','y')
