|
From: Mike M. <mtm...@ie...> - 2012-08-05 23:31:52
|
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). You can reply with any comments or fixes to either this email or the bug report: https://sourceforge.net/tracker/?func=detail&aid=3553263&group_id=2888&atid=102888 ========================================================== octave:7> test pei_tseng_notch ***** test ##2Hz bandwidth sf = 800; sf2 = sf/2; data=[sinetone(49,sf,10,1),sinetone(50,sf,10,1),sinetone(51,sf,10,1)]; [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 ) !!!!! test failed 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 |
|
From: Dr. A. K. <Ale...@ma...> - 2012-08-07 07:00:09
|
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. Alex -- Dr. Alexander Klein, Diplom-Mathematiker Physiologisches Institut der JLU-Gießen Aulweg 129 35392 Gießen http://www.med.uni-giessen.de/physio/ |
|
From: Mike M. <mtm...@ie...> - 2012-08-15 06:49:27
|
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 |
|
From: Dr. A. K. <Ale...@ma...> - 2012-08-15 07:23:13
|
Am 15.08.2012 um 08:49 schrieb Mike Miller: > Hi Alex, I made this change locally to use relative error, the tests > pass for me, is this what you had in mind? Exactly! If you like, please push the fix to the repository yourself. Best, Alex -- Dr. Alexander Klein, Diplom-Mathematiker Physiologisches Institut der JLU-Gießen Aulweg 129 35392 Gießen http://www.med.uni-giessen.de/physio/ |
|
From: Mike M. <mtm...@ie...> - 2012-08-15 14:50:58
|
On Wed, Aug 15, 2012 at 3:22 AM, Dr. Alexander Klein wrote: > Am 15.08.2012 um 08:49 schrieb Mike Miller: > >> Hi Alex, I made this change locally to use relative error, the tests >> pass for me, is this what you had in mind? > > Exactly! If you like, please push the fix to the repository yourself. Done, thanks for your help. -- mike |
|
From: Dr. A. K. <Ale...@ma...> - 2012-08-15 14:59:19
|
Am 15.08.2012 um 16:50 schrieb Mike Miller: > assert ( damp_db, [ -3 -251.9 -3 ], -0.1 ) Mike, would you mind trying with -0.01 as the relative tolerance? A 10% limit seems a bit much ... Later, Alex -- Dr. Alexander Klein, Diplom-Mathematiker Physiologisches Institut der JLU-Gießen Aulweg 129 35392 Gießen http://www.med.uni-giessen.de/physio/ |
|
From: Mike M. <mtm...@ie...> - 2012-08-15 15:29:16
|
On Wed, Aug 15, 2012 at 10:58 AM, Dr. Alexander Klein wrote: > Am 15.08.2012 um 16:50 schrieb Mike Miller: > >> assert ( damp_db, [ -3 -251.9 -3 ], -0.1 ) > > Mike, > > would you mind trying with -0.01 as the relative tolerance? A 10% limit seems a bit much ... On my system I get maximum relative errors of 0.0311534 and 0.0172248 for the 2 Hz and 1 Hz bandwidth cases respectively so 1% is too low. We could set the limit somewhere in between 3% and 10%. Or would calculating the error on a linear scale rather than dB be more appropriate? I haven't tried that yet. -- mike |