5

I am drawing spectrograms using the sample code aurio touch provided by apple. Now I want to compare the two spectrograms in iOS to see if they are same. Is it possible to compare the two spectrograms using the Accelerate framework?

If it is possible, does anyone know how to compare two spectrograms? If not, is there any other algorithm or library which can be used in iOS for comparing spectrograms?

Prerna chavan
  • 3,179
  • 7
  • 35
  • 77

3 Answers3

7

What you're looking for is called cross-correlation. It's doesn't involve the spectrograms directly, but is based on the same math that allows the spectrograms to be drawn (the Fourier Transform). There's a DSP stack exchange answer here: How do I implement cross-correlation to prove two audio files are similar? that covers the basics of implementing this.

Community
  • 1
  • 1
2

The Accelerate framework will only help you with low-level things like vector and matrix arithmetic, Fourier transforms, etc. What you need to do is figure out how to compare two spectrograms (whatever you mean by compare) using pencil and paper (or just your head if you're pro) and then implement it in code with the aid of frameworks such as Accelerate.

fumoboy007
  • 5,345
  • 4
  • 32
  • 49
1

vDSP has all of the building blocks to do cross correlation and convolution, which is what you would need to implement this.

https://developer.apple.com/library/mac/#documentation/Accelerate/Reference/vDSPRef/Reference/reference.html

quellish
  • 21,123
  • 4
  • 76
  • 83