{"action":"created","issue":{"url":"https://api.github.com/repos/librosa/librosa/issues/748","repository_url":"https://api.github.com/repos/librosa/librosa","labels_url":"https://api.github.com/repos/librosa/librosa/issues/748/labels{/name}","comments_url":"https://api.github.com/repos/librosa/librosa/issues/748/comments","events_url":"https://api.github.com/repos/librosa/librosa/issues/748/events","html_url":"https://github.com/librosa/librosa/issues/748","id":340814087,"node_id":"MDU6SXNzdWUzNDA4MTQwODc=","number":748,"title":"Marginal difference between dot(Mel(htk=True, norm=True), D and enorm*dot(Mel(htk=true, norm=False), D)","user":{"login":"rafaelvalle","id":2302607,"node_id":"MDQ6VXNlcjIzMDI2MDc=","avatar_url":"https://avatars2.githubusercontent.com/u/2302607?v=4","gravatar_id":"","url":"https://api.github.com/users/rafaelvalle","html_url":"https://github.com/rafaelvalle","followers_url":"https://api.github.com/users/rafaelvalle/followers","following_url":"https://api.github.com/users/rafaelvalle/following{/other_user}","gists_url":"https://api.github.com/users/rafaelvalle/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelvalle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelvalle/subscriptions","organizations_url":"https://api.github.com/users/rafaelvalle/orgs","repos_url":"https://api.github.com/users/rafaelvalle/repos","events_url":"https://api.github.com/users/rafaelvalle/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelvalle/received_events","type":"User","site_admin":false},"labels":[{"id":230707459,"node_id":"MDU6TGFiZWwyMzA3MDc0NTk=","url":"https://api.github.com/repos/librosa/librosa/labels/discussion","name":"discussion","color":"eb6420","default":false},{"id":16995039,"node_id":"MDU6TGFiZWwxNjk5NTAzOQ==","url":"https://api.github.com/repos/librosa/librosa/labels/wontfix","name":"wontfix","color":"ffffff","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-12T22:01:58Z","updated_at":"2018-07-13T22:43:43Z","closed_at":"2018-07-13T22:43:43Z","author_association":"NONE","body":"#### Description\r\nThis probably is just a byproduct of numerical precision after the dot product. \r\nReporting for sanity checking.\r\n\r\n#### Steps/Code to Reproduce\r\n\r\n```\r\nimport numpy as np\r\nimport librosa\r\n\r\n# load audio and power spectrogram\r\ny, sr = librosa.load(librosa.util.example_audio_file())\r\ny = y[:sr*2]\r\nD = np.abs(librosa.stft(y))**2\r\n\r\n# define params\r\nhtk = True\r\nfmin = 0.0\r\nfmax = 8000\r\nn_mels = 80\r\nnfft = 2048\r\n\r\n# Build mel filters with and without normalization.\r\nmel_fil_nonorm = mel(sr, nfft, nmels, fmin, fmax, htk=htk, norm=None)\r\nmel_fil_norm = mel(sr, nfft, nmels, fmin, fmax, htk=htk, norm=1)\r\n\r\n#  Build energy normalization vector\r\nmel_f = mel_frequencies(n_mels + 2, fmin=fmin, fmax=fmax, htk=htk)\r\nenorm = 2.0 / (mel_f[2:n_mels+2] - mel_f[:n_mels])        \r\n\r\n# Project spectrogram to mel-basis\r\nmelspec_nonorm = np.dot(mel_fil_nonorm, D)\r\nmelspec_norm = np.dot(mel_fil_norm, D)\r\n\r\n# Scale mel-spectrogram with energy normalization\r\nmelspec_postnorm = melspec_nonorm * enorm[:, None]\r\n\r\n# Compute sum of differences between norm and postnorm\r\nresidual = np.sum(melspec_norm - melspec_postnorm)\r\n```\r\n\r\n#### Expected Results\r\nresidual = 0\r\n\r\n#### Actual Results\r\nresidual = -1.2919472544229937e-13\r\n\r\n#### Versions\r\nDarwin-17.6.0-x86_64-i386-64bit\r\nPython 3.6.3 (default, Oct  4 2017, 06:09:38) \r\n[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]\r\nNumPy 1.14.0\r\nSciPy 1.0.0\r\nlibrosa 0.5.1"},"comment":{"url":"https://api.github.com/repos/librosa/librosa/issues/comments/404971736","html_url":"https://github.com/librosa/librosa/issues/748#issuecomment-404971736","issue_url":"https://api.github.com/repos/librosa/librosa/issues/748","id":404971736,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDk3MTczNg==","user":{"login":"rafaelvalle","id":2302607,"node_id":"MDQ6VXNlcjIzMDI2MDc=","avatar_url":"https://avatars2.githubusercontent.com/u/2302607?v=4","gravatar_id":"","url":"https://api.github.com/users/rafaelvalle","html_url":"https://github.com/rafaelvalle","followers_url":"https://api.github.com/users/rafaelvalle/followers","following_url":"https://api.github.com/users/rafaelvalle/following{/other_user}","gists_url":"https://api.github.com/users/rafaelvalle/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelvalle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelvalle/subscriptions","organizations_url":"https://api.github.com/users/rafaelvalle/orgs","repos_url":"https://api.github.com/users/rafaelvalle/repos","events_url":"https://api.github.com/users/rafaelvalle/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelvalle/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T22:43:43Z","updated_at":"2018-07-13T22:43:43Z","author_association":"NONE","body":"Sounds good! Closing."}}
{"actor":{"display_login":"rafaelvalle"}}