-
Notifications
You must be signed in to change notification settings - Fork 18
/
eegplugin_firfilt.m
64 lines (55 loc) · 2.61 KB
/
eegplugin_firfilt.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
% eegplugin_firfilt() - EEGLAB plugin for filtering data using linear-
% phase FIR filters
%
% Usage:
% >> eegplugin_firfilt(fig, trystrs, catchstrs);
%
% Inputs:
% fig - [integer] EEGLAB figure
% trystrs - [struct] "try" strings for menu callbacks.
% catchstrs - [struct] "catch" strings for menu callbacks.
%
% Author: Andreas Widmann, University of Leipzig, Germany, 2005
%123456789012345678901234567890123456789012345678901234567890123456789012
% Copyright (C) 2005 Andreas Widmann, University of Leipzig, [email protected]
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
function vers = eegplugin_firfilt(fig, trystrs, catchstrs)
vers = 'firfilt2.8';
if nargin < 3
error('eegplugin_firfilt requires 3 arguments');
end
% add folder to path
% -----------------------
if ~exist('pop_firws')
p = which('eegplugin_firfilt');
p = p(1:findstr(p,'eegplugin_firfilt.m')-1);
addpath([p vers]);
end
% find import data menu
% ---------------------
menu = findobj(fig, 'tag', 'filter');
% menu callbacks
% --------------
comfirfiltnew = [trystrs.no_check '[EEG LASTCOM] = pop_eegfiltnew(EEG);' catchstrs.new_and_hist];
comfirws = [trystrs.no_check '[EEG LASTCOM] = pop_firws(EEG);' catchstrs.new_and_hist];
comfirpm = [trystrs.no_check '[EEG LASTCOM] = pop_firpm(EEG);' catchstrs.new_and_hist];
comfirma = [trystrs.no_check '[EEG LASTCOM] = pop_firma(EEG);' catchstrs.new_and_hist];
% create menus if necessary
% -------------------------
uimenu( menu, 'Label', 'Basic FIR filter (new, default)', 'CallBack', comfirfiltnew, 'position', 1, 'userdata', 'study:on');
uimenu( menu, 'Label', 'Windowed sinc FIR filter', 'CallBack', comfirws, 'position', 2);
uimenu( menu, 'Label', 'Parks-McClellan (equiripple) FIR filter', 'CallBack', comfirpm, 'position', 3);
uimenu( menu, 'Label', 'Moving average FIR filter', 'CallBack', comfirma, 'position', 4);