Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
musicinformationretrieval-com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
A.S.
musicinformationretrieval-com
Commits
05c82791
Commit
05c82791
authored
Jun 25, 2014
by
Leigh Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added DistributionShape usage
parent
dfc7a04b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
crossValidationTemplate.py
sources/crossValidationTemplate.py
+4
-3
No files found.
sources/crossValidationTemplate.py
View file @
05c82791
...
...
@@ -11,7 +11,7 @@ from sklearn import preprocessing
import
urllib2
# the lib that handles the url stuff
import
urllib
from
essentia.standard
import
MonoLoader
from
essentia.standard
import
ZeroCrossingRate
,
CentralMoments
,
Spectrum
,
Windowing
,
Centroid
from
essentia.standard
import
ZeroCrossingRate
,
CentralMoments
,
Spectrum
,
Windowing
,
Centroid
,
DistributionShape
# Here are examples of how scaling functions would be written, however nowdays SciKit
# Learn will do it for you with the MinMaxScaler!
...
...
@@ -122,6 +122,7 @@ def spectral_features(filelist):
hamming_window
=
Windowing
(
type
=
'hamming'
)
# we need to window the frame to avoid FFT artifacts.
spectrum
=
Spectrum
()
central_moments
=
CentralMoments
()
distributionshape
=
DistributionShape
()
spectral_centroid
=
Centroid
()
frame_size
=
int
(
round
(
0.100
*
sample_rate
))
# 100ms
...
...
@@ -131,8 +132,8 @@ def spectral_features(filelist):
features
[
file_index
,
0
]
=
zcr
(
current_frame
)
spectral_magnitude
=
spectrum
(
hamming_window
(
current_frame
))
centroid
=
spectral_centroid
(
spectral_magnitude
)
spectral_moments
=
central_moments
(
spectral_magnitude
)
spectral_moments
=
distributionshape
(
central_moments
(
spectral_magnitude
)
)
features
[
file_index
,
1
]
=
centroid
features
[
file_index
,
2
:
5
]
=
spectral_moments
[
2
:
5
]
features
[
file_index
,
2
:
5
]
=
spectral_moments
return
features
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment