Rthur2003 commited on
Commit
7b2d19a
·
1 Parent(s): 017841c

feat: extend AudioFeatures dataclass with additional spectral and temporal metrics

Browse files
Files changed (1) hide show
  1. app/services/feature_extractor.py +20 -0
app/services/feature_extractor.py CHANGED
@@ -41,15 +41,35 @@ class AudioFeatures:
41
  duration_sec: float
42
  sample_rate: int
43
  rms_energy: float
 
44
  tempo_bpm: float
45
  tempo_stability: float # std of inter-beat intervals
 
46
  spectral_centroid_mean: float
47
  spectral_centroid_std: float
48
  spectral_flatness_mean: float
 
 
 
 
 
 
 
49
  mfcc_variance: float # mean variance across MFCC bands
 
 
50
  chroma_entropy: float # entropy of chroma distribution
 
 
51
  harmonic_ratio: float # harmonic / (harmonic + percussive)
 
52
  zero_crossing_rate: float
 
 
 
 
 
 
53
 
54
 
55
  @dataclass
 
41
  duration_sec: float
42
  sample_rate: int
43
  rms_energy: float
44
+ rms_std: float
45
  tempo_bpm: float
46
  tempo_stability: float # std of inter-beat intervals
47
+ tempo_cv: float # coefficient of variation of beat intervals
48
  spectral_centroid_mean: float
49
  spectral_centroid_std: float
50
  spectral_flatness_mean: float
51
+ spectral_flatness_std: float
52
+ spectral_bandwidth_mean: float
53
+ spectral_bandwidth_std: float
54
+ spectral_rolloff_mean: float
55
+ spectral_rolloff_std: float
56
+ spectral_contrast_mean: float
57
+ spectral_contrast_std: float
58
  mfcc_variance: float # mean variance across MFCC bands
59
+ mfcc_delta_var: float # mean variance of MFCC first derivative
60
+ mfcc_delta2_var: float # mean variance of MFCC second derivative
61
  chroma_entropy: float # entropy of chroma distribution
62
+ chroma_std: float # temporal chroma variability
63
+ chroma_transition_rate: float # pitch class change rate
64
  harmonic_ratio: float # harmonic / (harmonic + percussive)
65
+ tonnetz_std: float # tonal centroid variability
66
  zero_crossing_rate: float
67
+ zero_crossing_std: float
68
+ onset_strength_mean: float
69
+ onset_strength_std: float
70
+ rms_dynamic_range: float
71
+ beat_count: int
72
+ mel_flatness: float
73
 
74
 
75
  @dataclass