3

I want to compare two pieces of music to find similarities. But actually, I don't understand what Fast Fourier Transform is. I don't even know the parameter of the FFT function(from https://gist.github.com/mbijon/1332348).

My questions are:

  1. What are the parameters to FFT function?
  2. Does getID3 function provide these parameters?
  3. If not, how can I get these paramaters?

Here is my code.

<?php
    require_once('assets/getID3/getid3/getid3.php');
    require_once('FFT.php');
    $getID3 = new getID3;
    $ThisFileInfo = $getID3->analyze("music.mp3");
    $bit_rate = $ThisFileInfo['audio']['bitrate'];
    var_dump($bit_rate);
?>
Kashif Nazar
  • 20,775
  • 5
  • 29
  • 46
HyeonJunOh
  • 734
  • 1
  • 8
  • 22
  • http://en.wikipedia.org/wiki/Fast_Fourier_transform – Kmeixner Jun 03 '15 at 14:33
  • 1
    Thank you for comment @Kmeixner. i already saw this wiki, but it makes me crazy... – HyeonJunOh Jun 03 '15 at 14:37
  • Yeah, that's understandable. I had an entire university engineering course dedicated to using FFT. It was long ago, I don't remember much, but it was a way to measure the frequency of waveforms such as soundwaves. This one's a little easier to understand: http://www.askamathematician.com/2012/09/q-what-is-a-fourier-transform-what-is-it-used-for/ – Kmeixner Jun 03 '15 at 14:53
  • 1
    The input to the FFT function in question is the audio data from your song (i.e the actual audio samples), and for the $sign parameter all you need to put is "1" because you want to perform a forward Fourier transform.I don't know if ID3 can provide you with that data because I am not familiar with getID3 and php. – KillaKem Jun 03 '15 at 15:07
  • 1
    I'm really appreciate @Kmeixner's and KillaKem's comment! – HyeonJunOh Jun 03 '15 at 15:14
  • @KillaKem you mean, input parameter is a file? – HyeonJunOh Jun 03 '15 at 15:15
  • No not the file but the actual data samples.A song contains a lot of metadata such as Artist Name, BitRate e.t.c and it also contains the actual audio song.You need to find some way of extracting the audio samples (these will be an array of numbers between -1 and 1) and then spacing that array with zeros before inputting them as an argument to the FFT function. – KillaKem Jun 03 '15 at 15:20

0 Answers0