Spaces:
Sleeping
Sleeping
justus-tobias
commited on
Commit
·
4bc22ca
1
Parent(s):
02b192c
mean frequency was actually the the mean magnitude, now fixed
Browse files- .gitignore +2 -0
- utils.py +4 -4
.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
convert2freq.py
|
2 |
+
combined.csv
|
utils.py
CHANGED
@@ -515,10 +515,10 @@ def segment_analysis(segment, sr, s1s2:list):
|
|
515 |
# RMS Energy
|
516 |
rms_energy = np.sqrt(np.mean(segment**2))
|
517 |
|
518 |
-
#
|
519 |
-
|
520 |
-
|
521 |
-
mean_frequency = np.mean(
|
522 |
|
523 |
s1_to_s2_duration = []
|
524 |
s2_to_s1_duration = []
|
|
|
515 |
# RMS Energy
|
516 |
rms_energy = np.sqrt(np.mean(segment**2))
|
517 |
|
518 |
+
# Calculate actual mean frequency
|
519 |
+
fft = np.fft.rfft(segment)
|
520 |
+
freqs = np.fft.rfftfreq(len(segment), d=1/sr)
|
521 |
+
mean_frequency = np.mean(freqs)
|
522 |
|
523 |
s1_to_s2_duration = []
|
524 |
s2_to_s1_duration = []
|