Skip to content

Commit

Permalink
For the LogMel: initializing the Mel features in the init method inst…
Browse files Browse the repository at this point in the history
…ead of the compute_features method.
  • Loading branch information
ax-le committed Jan 9, 2024
1 parent 08645aa commit ad1ba7a
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions msaf/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,8 @@ def __init__(self, file_struct, feat_type, sr=config.sample_rate,
# Init the parent
super().__init__(file_struct=file_struct, sr=sr, hop_length=hop_length,
feat_type=feat_type)
self.n_fft = n_fft
# Init the Mel parameters
self.n_mels = n_mels
self.f_min = f_min
self.f_max = f_max
self.mel = Mel(self.file_struct, self.feat_type, self.sr,self.hop_length,
n_fft,n_mels, f_min, f_max).features

@classmethod
def get_id(cls):
Expand All @@ -220,11 +217,7 @@ def compute_features(self):
The features, each row representing a feature vector for a give
time frame/beat.
"""
mel = Mel(self.file_struct, self.feat_type, self.sr,
self.hop_length, self.n_fft,
self.n_mels, self.f_min,
self.f_max).features
return librosa.power_to_db(mel)
return librosa.power_to_db(self.mel)

class MFCC(Features):
"""This class contains the implementation of the MFCC Features.
Expand Down

0 comments on commit ad1ba7a

Please sign in to comment.