-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
readded previous test_gabfirtight as test_gabwintight because it actu…
…ally tests gabwin
- Loading branch information
1 parent
9b539be
commit 3325246
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
function test_failed = test_gabwintight() | ||
%TEST_GABWINTIGHT Some of the windows returned from firwin are tight | ||
% immediatelly. This function tests for that | ||
test_failed = 0; | ||
|
||
|
||
|
||
disp(' =============== TEST_GABWINTIGHT ================'); | ||
|
||
disp('--- Used subroutines ---'); | ||
|
||
which gabwin | ||
which comp_window | ||
|
||
|
||
shouldBeTight = [... | ||
struct('g','sine','a',10,'M',40,'L',[]),... | ||
struct('g',{{'sine',40}},'a',10,'M',40,'L',[]),... | ||
struct('g',{{'sine',28}},'a',14,'M',40,'L',[]),... | ||
struct('g','sine','a',20,'M',40,'L',[]),... | ||
struct('g',{{'sine',60}},'a',20,'M',60,'L',[]),... | ||
struct('g',{{'sine',54}},'a',18,'M',60,'L',[]),... | ||
struct('g',{{'sine',54,'inf'}},'a',18,'M',60,'L',[]),... | ||
struct('g','sine','a',5,'M',40,'L',[]),... | ||
struct('g','sqrttria','a',5,'M',40,'L',[]),... | ||
]; | ||
|
||
shouldNotBeTight = [... | ||
struct('g','sine','a',16,'M',40,'L',[]),... | ||
struct('g',{{'sine',41}},'a',10,'M',40,'L',[]),... | ||
struct('g',{{'sine',26}},'a',10,'M',40,'L',[]),... | ||
struct('g','sqrttria','a',40,'M',40,'L',[]),... | ||
]; | ||
|
||
|
||
for ii=1:numel(shouldBeTight) | ||
gw = shouldBeTight(ii); | ||
|
||
[~,info] = gabwin(gw.g,gw.a,gw.M,gw.L); | ||
[test_failed,fail]=ltfatdiditfail(~info.istight,test_failed,0); | ||
fprintf(['GABWINISTIGHT g= a=%i M=%i %s\n'],gw.a,gw.M,fail); | ||
|
||
end | ||
|
||
for ii=1:numel(shouldNotBeTight) | ||
gw = shouldNotBeTight(ii); | ||
|
||
[~,info] = gabwin(gw.g,gw.a,gw.M,gw.L); | ||
[test_failed,fail]=ltfatdiditfail(info.istight,test_failed,0); | ||
fprintf(['GABWINISNOTTIGHT g= a=%i M=%i %s\n'],gw.a,gw.M,fail); | ||
|
||
end |