Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MINOTAuR
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
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
Show more breadcrumbs
MINOTAuR
MINOTAuR
Commits
3ace7077
Commit
3ace7077
authored
6 years ago
by
Heiko Falk
Browse files
Options
Downloads
Patches
Plain Diff
Replaced double constants using exponent notation by numerical constant.
parent
334a273b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bench/kernel/lms/ChangeLog.txt
+1
-0
1 addition, 0 deletions
bench/kernel/lms/ChangeLog.txt
bench/kernel/lms/lms.c
+4
-3
4 additions, 3 deletions
bench/kernel/lms/lms.c
with
5 additions
and
3 deletions
bench/kernel/lms/ChangeLog.txt
+
1
−
0
View file @
3ace7077
...
...
@@ -10,3 +10,4 @@ Original provenience: C Algorithms for Real-Time DSP by Paul M. Embree, pp. 159,
* Output printed to stdout but was not checked for correctness
* lms() used static variables for internal state
- Completely rewritten and published with ISC license
- Replaced double constants using exponent notation by numerical constant.
This diff is collapsed.
Click to expand it.
bench/kernel/lms/lms.c
+
4
−
3
View file @
3ace7077
...
...
@@ -66,7 +66,7 @@ double lms_sinus( int i )
{
int
s
=
i
%
(
4
*
SAMPLING
);
if
(
s
>=
(
2
*
SAMPLING
)
)
return
-
lms_sintab
[(
s
>
3
*
SAMPLING
)
?
return
-
lms_sintab
[(
s
>
3
*
SAMPLING
)
?
(
4
*
SAMPLING
-
s
)
:
(
s
-
2
*
SAMPLING
)];
return
lms_sintab
[(
s
>
SAMPLING
)
?
(
2
*
SAMPLING
-
s
)
:
s
];
}
...
...
@@ -81,12 +81,13 @@ void lms_init( void )
_Pragma
(
"loopbound min 101 max 101"
)
for
(
k
=
0
;
k
<
N
;
k
+=
2
)
{
double
v1
,
v2
,
r
;
const
double
scaleFactor
=
0
.
000000000
931322574615478515625
;
do
{
// generate two random numbers between -1.0 and +1.0
seed
=
seed
*
1103515245
+
12345
;
v1
=
(
seed
&
0x00007fffffff
)
*
0x1
p
-
30
-
1
.
0
;
v1
=
(
seed
&
0x00007fffffff
)
*
scaleFactor
-
1
.
0
;
seed
=
seed
*
1103515245
+
12345
;
v2
=
(
seed
&
0x00007fffffff
)
*
0x1
p
-
30
-
1
.
0
;
v2
=
(
seed
&
0x00007fffffff
)
*
scaleFactor
-
1
.
0
;
r
=
v1
*
v1
+
v2
*
v2
;
}
while
(
r
>
1
.
0
);
// radius < 1
...
...
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