Home > m > gui > ltpdv > callbacks > ltpdv_filter_from_standard_panel.m

ltpdv_filter_from_standard_panel

PURPOSE ^

LTPDV_FILTER_FROM_STANDARD_PANEL builds a filter from the description on

SYNOPSIS ^

function filt = ltpdv_filter_from_standard_panel(panh)

DESCRIPTION ^

 LTPDV_FILTER_FROM_STANDARD_PANEL builds a filter from the description on
 the standard filter panel.
 
 M Hewitson 24-04-08
 
 $Id: ltpdv_filter_from_standard_panel.m,v 1.1 2008/05/11 10:38:43 hewitson Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function filt = ltpdv_filter_from_standard_panel(panh)
0002 % LTPDV_FILTER_FROM_STANDARD_PANEL builds a filter from the description on
0003 % the standard filter panel.
0004 %
0005 % M Hewitson 24-04-08
0006 %
0007 % $Id: ltpdv_filter_from_standard_panel.m,v 1.1 2008/05/11 10:38:43 hewitson Exp $
0008 %
0009 
0010 
0011 % Filter type
0012 h     = findobj(panh, 'Tag', 'LTPDVfiltStandardType');
0013 idx   = get(h, 'Value');
0014 strs  = get(h, 'String');
0015 ftype = strs{idx};
0016 
0017 disp(sprintf('** Building %s filter', ftype))
0018 
0019 % Gain
0020 h     = findobj(panh, 'Tag', 'LTPDVfiltStandardGain');
0021 gain  = str2double(get(h, 'String'));
0022 
0023 % Fc
0024 h  = findobj(panh, 'Tag', 'LTPDVfiltStandardCutoff');
0025 fc = str2num(get(h, 'String'));
0026 
0027 % Fs
0028 h  = findobj(panh, 'Tag', 'LTPDVfiltStandardFs');
0029 fs = str2double(get(h, 'String'));
0030 
0031 % Order
0032 h     = findobj(panh, 'Tag', 'LTPDVfiltStandardOrder');
0033 order = str2double(get(h, 'String'));
0034 
0035 % Ripple
0036 h      = findobj(panh, 'Tag', 'LTPDVfiltStandardRipple');
0037 ripple = str2double(get(h, 'String'));
0038 
0039 % Build plist
0040 pl = plist('type', lower(ftype), ...
0041            'Gain', gain, ...
0042            'fc', fc, ...
0043            'fs', fs, ...
0044            'order', order, ...
0045            'ripple', ripple);
0046         
0047 % Build filter
0048 filt = miir(pl);
0049 
0050 % END

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003