0001 function filt = redesign(filt, fs)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 disp(sprintf('*** re-designing filter for fs=%2.2f Hz...', fs));
0013 fpl = get(filt, 'plist');
0014 type = find(fpl, 'type');
0015 pzm = find(fpl, 'pzmodel');
0016
0017 if strcmp(type, 'highpass') ||...
0018 strcmp(type, 'lowpass') ||...
0019 strcmp(type, 'bandpass') ||...
0020 strcmp(type, 'bandreject')
0021
0022 disp(' - re-designing standard filter.');
0023 try
0024 fpl = set(fpl, 'fs', fs);
0025 disp(' - setting new fs.');
0026 catch
0027 fpl = append(fpl, 'fs', fs);
0028 disp(' - appending parameter fs.');
0029 end
0030 filtnew = miir(fpl);
0031 filtnew = set(filtnew, 'histin', get(filt, 'histin'));
0032 filtnew = set(filtnew, 'histout', get(filt, 'histout'));
0033 filt = filtnew;
0034 elseif ~isempty(pzm)
0035
0036 disp(' - re-designing pzmodel filter.');
0037 filtnew = miir(plist([param('pzmodel', pzm) param('fs', fs)]));
0038 filtnew = set(filtnew, 'histin', get(filt, 'histin'));
0039 filtnew = set(filtnew, 'histout', get(filt, 'histout'));
0040 filt = filtnew;
0041
0042 else
0043
0044 warning('!!! un-recognised input filter type. Can''t redesign.');
0045
0046
0047
0048 end
0049
0050
0051
0052
0053