Git Product home page Git Product logo

aca-code's Introduction

View ACA-Code on File Exchange DOI GitHub GitHub top language GitHub issues

ACA-Code

Matlab scripts accompanying the book "An Introduction to Audio Content Analysis" (www.AudioContentAnalysis.org). The source code shows example implementations of basic approaches, features, and algorithms for music audio content analysis.

All implementations are also available in:

functionality

The top-level functions are (alphabetical):

The names of the additional functions follow the following conventions:

The auto-generated documentation can be found here.

design principles

Please note that the provided code examples are only intended to showcase algorithmic principles – they are not entirely suitable for practical usage without parameter optimization and additional algorithmic tuning. Rather, they intend to show how to implement audio analysis solutions and to facilitate algorithmic understanding to enable the reader to design and implement their own analysis approaches.

minimal dependencies

The required dependencies are reduced to a minimum, more specifically to only the signal processing toolbox, for the following reasons:

  • accessibility, i.e., clear algorithmic implementation from scratch without obfuscation by using 3rd party implementations,
  • maintainability through independence of 3rd party code.

readability

Consistent variable naming and formatting, as well as the choice for simple implementations allow for easier parsing. The readability of the source code will sometimes come at the cost of lower performance.

cross-language comparability

All code is matched exactly with Python implementations and the equations in the book. This also means that the code might violate typical style conventions in order to be consistent.

related repositories and links

The source code in this repository is matched with corresponding source code in the Python repository. C++ implementations with identical functionality can be found in the C++ repository.

Other, related repositories are

  • ACA-Slides: slide decks for teaching and learning audio content analysis
  • ACA-Plots: Matlab scripts for generating all plots in the book and slides

The main entry point to all book-related information is AudioContentAnalysis.org

documentation

The documentation can be found at https://alexanderlerch.github.io/ACA-Code/.

getting started

example 1: computation and plot of the Spectral Centroid

% read audio file from cWavePath
[x, f_s] = audioread(cWavePath);

% compute SpectralCentroid
[v_sc, t] = ComputeFeature('SpectralCentroid', x, f_s);

% plot result
plot(t, v_sc), grid on, xlabel('t'), ylabel('v_sc')

aca-code's People

Contributors

alexanderlerch avatar kaushalsali avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aca-code's Issues

FeatureTimeMaxAcf.m - issue comparing empty arrays?

I was trying to figure out how this function works by playing implementing the same functionality in Python. In doing so, I'm not sure if I may have stumbled upon a bug, or if perhaps I am not understanding the function correctly.

In line 40, eta_tmp may take on the value [] (empty array) if the find() function does not find any afCorr values below the threshold. Then in line 41, the comparison between eta_min and eta_tmp will select the empty array, as this is apparently how Matlab's max() function handles them. (As it turns out, Python is different and will select the non-empty value over the empty array.)

Then starting in line 44, a similar process happens. And here, even if in line 45 a non-zero value is found for eta_tmp, in line 46, if eta_min has already taken on the value [] (due to line 41), then a comparison with the new value of eta_tmp will again select the empty array. I am not sure if this is the desired functionality.

I see that in line 48, there is a check to account for empty arrays, where eta_min is set to the default value if it has taken on the value []. Perhaps this same check should happen between the code blocks starting on lines 40 and 44, respectively? I think that might fix the issue of empty arrays dominating the max() calls.

Spectrogram

In spectral features, X denotes spectrogram with dimension: (fftlength) cross (observation). but when I put the spectrogram in let just say FeatureSpectralCentroid.m, it gives me an array of values instead of single value. Whats the matter?

Note: I'm using y=spectrogram(signal) in MATLAB to obtain spectrogram

some how it shows that f is unused !!

    % in the real world, we would do this block by block...
    [X,f,t]     = spectrogram(  afAudioData,...
                                afWindow,...
                                iBlockLength-iHopLength,...

1111

                                iBlockLength,...
                                f_s);

[v_sc,t] = ComputeFeature('SpectralCentroid', afAudioData, fs);
Error using spectrogram
Too many input arguments.

Error in ComputeFeature (line 71)
[X,t] = spectrogram(
afAudioData,...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.