Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
bdf0f628
Unverified
Commit
bdf0f628
authored
Feb 13, 2018
by
Manoj Plakal
Committed by
GitHub
Feb 13, 2018
Browse files
Cosmetic changes to spectrogram_to_mel_matrix()
To simplify syncing this c ode back into Google.
parent
982a5504
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
research/audioset/mel_features.py
research/audioset/mel_features.py
+2
-2
No files found.
research/audioset/mel_features.py
View file @
bdf0f628
...
...
@@ -150,7 +150,7 @@ def spectrogram_to_mel_matrix(num_mel_bins=20,
An np.array with shape (num_spectrogram_bins, num_mel_bins).
Raises:
ValueError: if frequency edges are incorrectly ordered.
ValueError: if frequency edges are incorrectly ordered
or out of range
.
"""
nyquist_hertz
=
audio_sample_rate
/
2.
if
lower_edge_hertz
<
0.0
:
...
...
@@ -160,7 +160,7 @@ def spectrogram_to_mel_matrix(num_mel_bins=20,
(
lower_edge_hertz
,
upper_edge_hertz
))
if
upper_edge_hertz
>
nyquist_hertz
:
raise
ValueError
(
"upper_edge_hertz %.1f is greater than Nyquist %.1f"
%
(
upper_edge_hertz
,
nyquist_hertz
))
(
upper_edge_hertz
,
nyquist_hertz
))
spectrogram_bins_hertz
=
np
.
linspace
(
0.0
,
nyquist_hertz
,
num_spectrogram_bins
)
spectrogram_bins_mel
=
hertz_to_mel
(
spectrogram_bins_hertz
)
# The i'th mel band (starting from i=1) has center frequency
...
...
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