<jupyter_start><jupyter_text>Mel Spectrum, MFCC, LPC A typical spectrogram uses a linear frequency scaling, so each frequency bin is spaced the equal number of Hertz apart. The mel-frequency scale on the other hand, is a quasi-logarithmic spacing roughly resembling the resolution of the human auditory system.This makes the MFCC features more “biologically inspired”. As far as I know such front-ends have been proven to be more successful in automatic speech recognition or speech segregation.How MFCC is computed? First you compute the mel frequency specrogram, log it then take the discrete cosine transform. The last stage is a linear operation so can be absorbed into the first layer of the neural network. So really the main difference is whether you log the mel frequency specrogram or not (and maybe power normalise). In terms of performance, the mel filterbank is slightly ahead, but not by much. There are two philosophical advantages, firstly it is often good to get the DNN to learn complex representations and not impose them, and secondly I've always hated the log, it's quite reasonable to have no power in a frequency range, so you end up fudging things to avoid ln(0).<jupyter_code>cost = np.zeros((n,m))
#print(cost)
for i in range(n):
    for j in range(m):
        cost[i,j] = (template_wav_mfcc_1D[j]- input_wav_mfcc_1D[i])**2
        
#savetxt("cost.csv",cost,",")

#part_cost = cost[0:100,0:100]
#print(part_cost)
#print(part_cost.shape)
def cost_plot(matrix):
    im = plt.imshow(matrix, interpolation='nearest', cmap='Reds')
    plt.gca().invert_yaxis()
    plt.xlabel("input")
    plt.ylabel("template")
    plt.grid()
    plt.colorbar()
cost_plot(cost)
accumulated_cost = np.zeros((n,m))
accumulated_cost[0,0] = cost[0,0]
print(accumulated_cost[0,0])
cost_plot(accumulated_cost)
for idx in range(1,n):
    accumulated_cost[0,idx] = cost[0,idx] + accumulated_cost[0,idx-1]
cost_plot(accumulated_cost)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08891159938681656, 'fraction_numerical': 0.011752682677567705, 'mean_word_length': 5.1572327044025155, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '646374', 'license': 'MIT', 'n_tokens_mistral': 621, 'n_tokens_neox': 589, 'n_words': 235, 'path': 'KWS/examples/dtw_sample03.ipynb', 'repo_name': 'xrick/DTW-Tutorial', 'size': '1957'}