1 % invfdemo demonstrates Inverse Filtering
3 % $Id: invfdemo.m 5090 2008-06-05 08:12:04Z schloegl $
\r% Copyright (C) 1997-2002,2008 by Alois Schloegl <a.schloegl@ieee.org>
5 % This program is free software: you can redistribute it and/or modify
6 % it under the terms of the GNU General Public License as published by
7 % the Free Software Foundation, either version 3 of the License, or
8 % (at your option) any later version.
10 % This program is distributed in the hope that it will be useful,
11 % but WITHOUT ANY WARRANTY; without even the implied warranty of
12 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 % GNU General Public License for more details.
15 % You should have received a copy of the GNU General Public License
16 % along with this program. If not, see <http://www.gnu.org/licenses/>.
18 load eeg8s.mat; % load signal
21 %a=earpyw(eeg8s',11); % Calculates AR(11) parameters with Yule-Walker method
22 a=lattice(eeg8s',11); % Calculates AR(11) parameters with Yule-Walker method
23 % The AR parameters are the weight taps of IIR Filter
24 isig=filter([1 -a],1,eeg8s); % Inverse filtering
28 plot((1:ly)/Fs,eeg8s);
35 title('Inverse filtered process');
38 H=abs(fft(eeg8s,128)/ly).^2;
40 %plot([H mean(H)*ones(Fs,1)]);
43 title('Spectrum of original signal');
46 H=abs(fft(isig,128)/ly).^2;
48 %plot([H mean(H)*ones(Fs,1)]);
51 title('Spectrum of inverse filtered signal');