On Tue, Aug 7, 2012 at 2:44 AM, Dr. Alexander Klein wrote: > Am 06.08.2012 um 01:31 schrieb Mike Miller: > >> Hi Alex, I see that you are the author of pei_tseng_notch, would you >> mind taking a look at the test failure? I get the same result as that >> shown in the report (reproduced below). > >> assert (damp_db,[-3, -251.9, -3],0.1) expected >> -3.0000 -251.9000 -3.0000 >> but got >> -3.0103 -250.7217 -3.0935 >> maximum absolute error 1.17825 exceeds tolerance 0.1 > > > Mike, > > the error is much too small to have any significant impact in > applications, and I should have chosen relative tolerances instead of > absolute ones right away. > > I'll fix that during the week.
Hi Alex, I made this change locally to use relative error, the tests pass for me, is this what you had in mind? --- pei_tseng_notch.m (revision 10874) +++ pei_tseng_notch.m (working copy) @@ -91,7 +91,7 @@ %! [b, a] = pei_tseng_notch ( 50 / sf2, 2 / sf2 ); %! filtered = filter ( b, a, data ); %! damp_db = 20 * log10 ( max ( filtered ( end - 1000 : end, : ) ) ); -%! assert ( damp_db, [ -3 -251.9 -3 ], 0.1 ) +%! assert ( damp_db, [ -3 -251.9 -3 ], -0.1 ) %!test %! ##1Hz bandwidth @@ -100,7 +100,7 @@ %! [b, a] = pei_tseng_notch ( 50 / sf2, 1 / sf2 ); %! filtered = filter ( b, a, data ); %! damp_db = 20 * log10 ( max ( filtered ( end - 1000 : end, : ) ) ); -%! assert ( damp_db, [ -3 -240.4 -3 ], 0.1 ) +%! assert ( damp_db, [ -3 -240.4 -3 ], -0.1 ) %!demo %! sf = 800; sf2 = sf/2; -- mike ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev