How to obtain a function from a sound?

9 visualizaciones (últimos 30 días)
Luis Zuniga
Luis Zuniga el 30 de Ag. de 2020
Comentada: Walter Roberson el 1 de Sept. de 2020
Hi! I have to work in a project where I have to analyze a piece of a song with different tools like the Fourier Transform. I have the audio and I know how to load and plot it but how can I obtain a function from the audio?
For example, a sine function of something similar.

Respuestas (1)

Walter Roberson
Walter Roberson el 30 de Ag. de 2020
When you read the audio in to an array, such as with audioread(), then what you get out is an array of data.
After that, the computation routines such as fft() or spectrogram() do not care how you got the data; they don't care whether you read it from a .wav, or pulled it out of the soundtrack for a movie, or recorded it out of midi sythesizer: they only care that you pass them data.
So you should be splitting your thoughts into two independent tasks: (1) reading the audio to produce an array of data; and (2) processing arrays of data.
There is, for example, no audiofft() function to process audio data: there is just fft() because the fft calculation does not care how you got the data.
  5 comentarios
Luis Zuniga
Luis Zuniga el 1 de Sept. de 2020
By function array, I mean the function of the sound as such. For instance, let's say my sound is the pitch A440. I already know how load the sound to Matlab, I would like to know how I can get the function of A440 which I believe is sine function.
I want to know this because in addtion to analyzing with the program, I must also do the proccess for one sound myself. So in addition to loading the notes of the instrument, I want to know how I can get the function for the combination of notes.
Walter Roberson
Walter Roberson el 1 de Sept. de 2020
https://www.mathworks.com/matlabcentral/answers/48717-create-a-piece-of-music-using-matlab

Iniciar sesión para comentar.

Categorías

Más información sobre Audio I/O and Waveform Generation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by