Skip to content

How to find mean and std of MFCC? #6

@insunhwang89

Description

@insunhwang89

The mean and std I created are different from the values in mfcc_stats.pkl you provided.

Can you please check if I am doing something wrong?

I attached a simple code below.

thanks.


mfcc_list = list()
for path in tqdm(wav_path):
        wav, sampling_rate = sf.read(path) 
        mfcc = librosa.feature.mfcc(y=wav, sr=sampling_rate, n_mfcc=80, n_fft=1024, hop_length=256) # [80, T] 
        mfcc_list.append(mfcc)

mfcc_list = np.concatenate(mfcc_list , axis=1) # [80, T]
mfcc_mean = mfcc_list.mean(axis=1) # [80]
mfcc_std = mfcc_list.std(axis=1) # [80]

dctmx = scipy.fftpack.dct(np.eye(80), type=2, axis=1, norm='ortho') # [80, 80] 

with open('assets/mfcc_stats.pkl', 'wb') as f:
        pickle.dump([mfcc_mean, mfcc_std, dctmx], f, pickle.HIGHEST_PROTOCOL)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions