EQ overloads the == operator for miir objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: EQ overloads the == operator for miir objects. Checks that the coefficients, the sample rate, and the gain are the same. CALL: result = eq(t1,t2) INPUTS: f1,f2 - input miir objects OUTPUTS: If the two miir objects are considered equal, result == 1, otherwise, result == 0. VERSION: $Id: param.m,v 1.7 2007/08/17 11:22:11 ingo Exp $ HISTORY: 29-08-2007 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function result = eq(f1,f2) 0002 0003 % EQ overloads the == operator for miir objects. 0004 % 0005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0006 % 0007 % DESCRIPTION: EQ overloads the == operator for miir objects. 0008 % 0009 % Checks that the coefficients, the sample rate, and the gain 0010 % are the same. 0011 % 0012 % CALL: result = eq(t1,t2) 0013 % 0014 % INPUTS: f1,f2 - input miir objects 0015 % 0016 % OUTPUTS: If the two miir objects are considered equal, result == 1, 0017 % otherwise, result == 0. 0018 % 0019 % VERSION: $Id: param.m,v 1.7 2007/08/17 11:22:11 ingo Exp $ 0020 % 0021 % HISTORY: 29-08-2007 M Hewitson 0022 % Creation 0023 % 0024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0025 0026 % Assume they are equal 0027 result = 1; 0028 0029 %% Check coefficients 0030 if f1.a ~= f2.a 0031 result = 0; 0032 return 0033 end 0034 if f1.b ~= f2.b 0035 result = 0; 0036 return 0037 end 0038 0039 %% Check gain 0040 if f1.g ~= f2.g 0041 result = 0; 0042 return 0043 end 0044 0045 %% Check sample rate 0046 if f1.fs ~= f2.fs 0047 result = 0; 0048 return 0049 end