Comments (5)
Absolutely! The first step would be to do some research and find a few different sources for the definition of this feature. We've found that often, different implementations of features do slightly different things or use slightly different terminology. We want to be approachable for developers coming from other tools, and try to keep the terminology we use similar to what other tools do. I'd suggest having a look at YAAFE, librosa, and essentia. Additionally, if there are any academic papers on the subject, those would be useful too. Let me know what you find and we can move on to the next step 😄
from meyda.
Let's keep this issue open to track the implementation?
from meyda.
I don't think we support that right now, but maybe we could - we support MFCCs, so I would think those are related. Are you interested in working on that?
from meyda.
Thanks a lot @hughrawlinson for quick response. Yes, I would like to work on that. Could you please guide me :)
from meyda.
I'm not sure whether my thought is right or not.
But I guess that the extractMelBands
in node_modules\meyda\dist\node\main.js
(for CLI and Nodejs) and node_modules\meyda\dist\web\meyda.js
(for web) is where compute a mel scaled spectrogram.
However it is log scaled. So I just copy the extractMelBands
, comment out the line melBands[i] = Math.log(melBands[i] + 1);
for log-transform, and change rename it into extractUnloggedMelBands
function extractUnloggedMelBands(_a) {
var ampSpectrum = _a.ampSpectrum, melFilterBank = _a.melFilterBank, bufferSize = _a.bufferSize;
if (!ampSpectrum || !melFilterBank) {
throw new TypeError("Valid ampSpectrum and melFilterBank are required to generate melBands");
}
var powSpec = extractPowerSpectrum({ ampSpectrum: ampSpectrum });
var numFilters = melFilterBank.length;
var filtered = new Array(numFilters).fill().map(() => new Float32Array(bufferSize / 2));
var melBands = new Float32Array(numFilters);
for (var i = 0; i < numFilters; i++) {
for (var j = 0; j < bufferSize / 2; j++) {
filtered[i][j] = melFilterBank[i][j] * powSpec[j];
melBands[i] += filtered[i][j];
}
// Skip the log transformation
// melBands[i] = Math.log(melBands[i] + 1); // commented out for unlogged version
}
return Array.from(melBands);
}
And then add a new config for it
var extractors = /*#__PURE__*/Object.freeze({
__proto__: null,
amplitudeSpectrum: amplitudeSpectrum,
buffer: buffer,
chroma: chroma,
complexSpectrum: complexSpectrum,
energy: energy,
loudness: loudness,
melBands: extractMelBands,
unloggedMelBands: extractUnloggedMelBands, // here!
.....
Finally, you can use features.unloggedMelBands
to call it
const analyzer = Meyda.createMeydaAnalyzer({
"audioContext": audioContext,
"source": source,
"bufferSize": 512,
"featureExtractors": ["rms", "mfcc","unloggedMelBands"],
"numberOfMFCCCoefficients":128,
"callback": features => {
console.log(features.unloggedMelBands);
}
});
from meyda.
Related Issues (20)
- Fluid Corpus Manipulation HOT 3
- Power spectrum for spectral descriptors HOT 4
- DTMF detection HOT 1
- Is mel-spectrum available? HOT 5
- Last line in csv HOT 3
- Hop size and weird result in WebAudio HOT 9
- Two features in WebAudio gets values out of range HOT 1
- Extracting MFCCs on Mobile Devices in React Native HOT 7
- How to get features in typescript without casting? HOT 2
- Running meyda in p5js for real time audio streaming HOT 2
- I want to import a part of music data. HOT 6
- sample page not working HOT 13
- Node 18 support HOT 2
- node v19 support?
- Code template HOT 1
- Please provide this project in react js HOT 5
- Web-version of Meyda (meyda.js & meyda.min.js in /src/dist/web) has a broken dependency problem HOT 5
- Finding formant (f1 and f2) from the audio features HOT 2
- Depreciated Web Audio API method in dist/node distribution lead to unusable analyser HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meyda.