hueyling_yeoh
New Member
hi
I'm designing a harmonic filter section for a portable radio.
The filter topology of this filter is the 5th order Elliptic. I plan to obtain the filter coefficients of of the design using Matlab and was wondering whether upon construction of the filter in sptool, that the attached m-file code excerpt would be able to correctly return the filter coefficients. If the attached m-file is unable to do so, are there any other methods that I can be able to do so?
Thanks for hearing me out.
Peace.
I'm designing a harmonic filter section for a portable radio.
The filter topology of this filter is the 5th order Elliptic. I plan to obtain the filter coefficients of of the design using Matlab and was wondering whether upon construction of the filter in sptool, that the attached m-file code excerpt would be able to correctly return the filter coefficients. If the attached m-file is unable to do so, are there any other methods that I can be able to do so?
Thanks for hearing me out.
Code:
function [num,den]=pfilt(name)
% Returns Numerator and Denomenator Values from
% SPTool SD 3/3/98
if nargin==0,name='filt1';end
f = sptool('Filters');
labels=char(f.label);
fn=strmatch(name,labels);
if(isempty(fn)),error('NO FILTER OF THAT NAME'),end
if(any(size(fn)>1)),error('AMBUIGUOUS FILTER NAME'),end
num=f(fn).tf.num;
den=f(fn).tf.den;
disp('Numerator');
disp(num');
disp('Denominator');
disp(den');
Peace.