Giter Club home page Giter Club logo

tlnmf's Introduction

Transform Learning for Non-Negative Matrix Factorization

Transform-learning NMF is a new method for music signal processing. Standard NMF is applied on the spectrogram of the musical signal. The spectrogram is classicaly obtained as the power of the Fourier transform of small windows of the signal. Instead of using the Fourier transform, TL-NMF learns it from the signals.

Principle

Given a matrix of positive entries V of size M x N, NMF learns matrices W and H of positive entries such that V is approximately WH. W is of size M x K, and H of size K x N, where K is the rank of the factorization. NMF is typically used in signal processing to factorize the spectrogram. The signal is cut into N short windows of size M, to form a frames matrix Y of size M x N. Then, a M x M DCT matrix, Phi, is used to form the spectrogram: V = (Phi Y)^2.

Instead of taking a fixed DCT transform, TL-NMF also learns Phi, straight from the signal.

Installation

To install the module tlnmf, you should first clone this repository:

$ git clone https://github.com/pierreablin/tlnmf.git

And then install it using pip:

$ pip install -e.

To check that everything worked, the following command should not return any error:

$ python -c 'import tlnmf'

Use

The main function in tlnmf is tlnmf.tl_nmf. Given a frames matrix Y and a rank K, it outputs the learned Phi, W, H. Read the docstring of the function for an accurate description of its parameters.

The function tlnmf.signal_to_frame is there to build the frames matrix from the signal.

The file examples/example_armstrong.py contains a practical example on the song My Heart by Louis Armstrong.

Dependencies

  • numpy (>=1.8)
  • matplotlib (>=1.3)
  • scipy (>=0.19)
  • soundfile (>=0.10.2)

tlnmf's People

Contributors

pierreablin avatar

Watchers

James Cloos avatar

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.