Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
faust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.11.3.
Show more breadcrumbs
faust group
faust
Commits
8e50a9b6
Commit
8e50a9b6
authored
4 years ago
by
hhakim
Browse files
Options
Downloads
Patches
Plain Diff
Fix a bug on normed parameter of matfaust.wht and dft and complete their unit tests.
parent
7496f047
Branches
Branches containing commit
Tags
3.2.9
Tags containing commit
No related merge requests found
Pipeline
#834047
skipped
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
misc/test/src/Matlab/FaustFactoryTest.m
+6
-2
6 additions, 2 deletions
misc/test/src/Matlab/FaustFactoryTest.m
wrapper/matlab/+matfaust/dft.m
+1
-1
1 addition, 1 deletion
wrapper/matlab/+matfaust/dft.m
wrapper/matlab/+matfaust/wht.m
+1
-1
1 addition, 1 deletion
wrapper/matlab/+matfaust/wht.m
with
8 additions
and
4 deletions
misc/test/src/Matlab/FaustFactoryTest.m
+
6
−
2
View file @
8e50a9b6
...
@@ -353,7 +353,7 @@ classdef FaustFactoryTest < matlab.unittest.TestCase
...
@@ -353,7 +353,7 @@ classdef FaustFactoryTest < matlab.unittest.TestCase
import
matfaust
.*
import
matfaust
.*
log2n
=
randi
([
1
,
6
]);
log2n
=
randi
([
1
,
6
]);
n
=
2
^
log2n
;
n
=
2
^
log2n
;
H
=
wht
(
n
,
false
);
H
=
wht
(
n
,
'normed'
,
false
);
fH
=
full
(
H
);
fH
=
full
(
H
);
this
.
verifyEqual
(
nnz
(
fH
),
numel
(
fH
));
this
.
verifyEqual
(
nnz
(
fH
),
numel
(
fH
));
i
=
1
;
i
=
1
;
...
@@ -366,6 +366,8 @@ classdef FaustFactoryTest < matlab.unittest.TestCase
...
@@ -366,6 +366,8 @@ classdef FaustFactoryTest < matlab.unittest.TestCase
i
=
i
+
1
;
i
=
i
+
1
;
end
end
this
.
assertEqual
(
full
(
wht
(
n
)),
full
(
normalize
(
H
)),
'AbsTol'
,
10
^-
7
)
this
.
assertEqual
(
full
(
wht
(
n
)),
full
(
normalize
(
H
)),
'AbsTol'
,
10
^-
7
)
this
.
assertEqual
(
full
(
wht
(
n
,
'normed'
,
false
)),
full
(
H
),
'AbsTol'
,
10
^-
7
)
end
end
function
testFourier
(
this
)
function
testFourier
(
this
)
...
@@ -373,12 +375,14 @@ classdef FaustFactoryTest < matlab.unittest.TestCase
...
@@ -373,12 +375,14 @@ classdef FaustFactoryTest < matlab.unittest.TestCase
import
matfaust
.
dft
import
matfaust
.
dft
log2n
=
randi
([
1
,
10
]);
log2n
=
randi
([
1
,
10
]);
n
=
2
^
log2n
;
n
=
2
^
log2n
;
F
=
dft
(
n
,
false
);
F
=
dft
(
n
,
'normed'
,
false
);
fF
=
full
(
F
);
fF
=
full
(
F
);
fftI
=
fft
(
eye
(
n
));
fftI
=
fft
(
eye
(
n
));
% this.verifyEqual(nnz(fH), numel(fH));
% this.verifyEqual(nnz(fH), numel(fH));
this
.
verifyEqual
(
norm
(
fF
-
fftI
),
0
,
'AbsTol'
,
10
^-
12
);
this
.
verifyEqual
(
norm
(
fF
-
fftI
),
0
,
'AbsTol'
,
10
^-
12
);
this
.
assertEqual
(
full
(
dft
(
n
)),
full
(
normalize
(
F
)),
'AbsTol'
,
10
^-
7
)
this
.
assertEqual
(
full
(
dft
(
n
)),
full
(
normalize
(
F
)),
'AbsTol'
,
10
^-
7
)
this
.
assertEqual
(
full
(
dft
(
n
,
'normed'
,
false
)),
full
(
F
),
'AbsTol'
,
10
^-
7
)
end
end
function
test_sp
(
this
)
function
test_sp
(
this
)
...
...
This diff is collapsed.
Click to expand it.
wrapper/matlab/+matfaust/dft.m
+
1
−
1
View file @
8e50a9b6
...
@@ -68,7 +68,7 @@ function F = dft(n, varargin)
...
@@ -68,7 +68,7 @@ function F = dft(n, varargin)
if
(
argc
==
i
||
~
islogical
(
tmparg
))
if
(
argc
==
i
||
~
islogical
(
tmparg
))
error
(
'normed keyword argument is not followed by a logical'
)
error
(
'normed keyword argument is not followed by a logical'
)
else
else
per_row
=
tmparg
;
normed
=
tmparg
;
end
end
case
'dev'
case
'dev'
if
(
argc
==
i
||
~
strcmp
(
tmparg
,
'cpu'
)
&&
~
startsWith
(
tmparg
,
'gpu'
))
if
(
argc
==
i
||
~
strcmp
(
tmparg
,
'cpu'
)
&&
~
startsWith
(
tmparg
,
'gpu'
))
...
...
This diff is collapsed.
Click to expand it.
wrapper/matlab/+matfaust/wht.m
+
1
−
1
View file @
8e50a9b6
...
@@ -66,7 +66,7 @@ function H = wht(n, varargin)
...
@@ -66,7 +66,7 @@ function H = wht(n, varargin)
if
(
argc
==
i
||
~
islogical
(
tmparg
))
if
(
argc
==
i
||
~
islogical
(
tmparg
))
error
(
'normed keyword argument is not followed by a logical'
)
error
(
'normed keyword argument is not followed by a logical'
)
else
else
per_row
=
tmparg
;
normed
=
tmparg
;
end
end
case
'dev'
case
'dev'
if
(
argc
==
i
||
~
strcmp
(
tmparg
,
'cpu'
)
&&
~
startsWith
(
tmparg
,
'gpu'
))
if
(
argc
==
i
||
~
strcmp
(
tmparg
,
'cpu'
)
&&
~
startsWith
(
tmparg
,
'gpu'
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment