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
fc3cd5dd
Commit
fc3cd5dd
authored
3 years ago
by
hhakim
Browse files
Options
Downloads
Patches
Plain Diff
Verify that c argument of matfaust.circ is a numerical vector.
parent
281d8dfc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wrapper/matlab/+matfaust/circ.m
+22
-14
22 additions, 14 deletions
wrapper/matlab/+matfaust/circ.m
with
22 additions
and
14 deletions
wrapper/matlab/+matfaust/circ.m
+
22
−
14
View file @
fc3cd5dd
%==========================================================================================
%==========================================================================================
%> @brief Returns a circulant Faust C defined by the vector c (which is the first column of
the
full(C)).
%> @brief Returns a circulant Faust C defined by the vector c (which is the first column of full(C)).
%>
%>
%> @b Example:
%> @b Example:
%>
%>
...
@@ -51,20 +51,28 @@
...
@@ -51,20 +51,28 @@
%> 0.2290 0.0838 0.4505 0.7482 0.6892 0.6541 0.2630 0.9133
%> 0.2290 0.0838 0.4505 0.7482 0.6892 0.6541 0.2630 0.9133
%> 0.9133 0.2290 0.0838 0.4505 0.7482 0.6892 0.6541 0.2630
%> 0.9133 0.2290 0.0838 0.4505 0.7482 0.6892 0.6541 0.2630
%> @endcode
%> @endcode
%>
%> @b See also matfaust.anticirc, matfaust.toeplitz
%> @b See also matfaust.anticirc, matfaust.toeplitz
%==========================================================================================
%==========================================================================================
function
C
=
circ
(
c
)
function
C
=
circ
(
c
)
log2c
=
log2
(
numel
(
c
));
log2c
=
log2
(
numel
(
c
));
if
(
log2c
~=
floor
(
log2c
))
if
(
log2c
~=
floor
(
log2c
))
error
(
'Only power of two length vectors are supported'
)
error
(
'Only power of two length vectors are supported'
)
end
end
n
=
numel
(
c
);
if
~
ismatrix
(
c
)
||
~
isnumeric
(
c
)
F
=
matfaust
.
dft
(
n
,
'normed'
,
false
);
error
(
'c must be numeric vector'
)
FH
=
F
'
;
end
if
(
size
(
c
,
1
)
<
size
(
c
,
2
))
if
size
(
c
,
2
)
==
1
c
=
c
.'
;
c
=
c
.'
;
end
elseif
size
(
c
,
1
)
~=
1
S
=
sparse
(
diag
(
FH
*
(
c
/
n
)));
error
(
'c must be a vector'
)
C
=
F
*
matfaust
.
Faust
(
S
*
factors
(
FH
,
1
))
*
right
(
FH
,
2
);
end
n
=
numel
(
c
);
F
=
matfaust
.
dft
(
n
,
'normed'
,
false
);
FH
=
F
'
;
if
(
size
(
c
,
1
)
<
size
(
c
,
2
))
c
=
c
.'
;
end
S
=
sparse
(
diag
(
FH
*
(
c
/
n
)));
C
=
F
*
matfaust
.
Faust
(
S
*
factors
(
FH
,
1
))
*
right
(
FH
,
2
);
end
end
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