Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Can I take the derivative of a function that represents a piece of music? The music is given in .mp3, .midi or whatever comes in handy.

share|improve this question
1  
Could you be a bit more specific? Do you want to take the derivative of a discrete-time sampled waveform? –  Mr.Wizard Jun 9 '13 at 12:35
    
@Mr.Wizard sorry, forgot that mp3 is not continuous waveform. Is the waveform of MIDI continuous/is there a simple way to perform fourier transform on a MIDI input? –  Alex Su Jun 9 '13 at 12:42
2  
Midi is like sheet music. If you want a waveform, convert mp3->wav with any external tool (this is easy to do) and then import the wav and work on it as bill sugested –  Rojo Jun 9 '13 at 12:51
1  
If the input is a MIDI, the following is relevant: stackoverflow.com/questions/7592596/… –  Corey Kelly Jun 9 '13 at 14:52
add comment

1 Answer

up vote 6 down vote accepted

In Mathematica, you can read in .wav files using Import. Since the data is then a discrete data sequence, you can't take a real calculus-style derivative, but you can take the derivative numerically, for instance, using functions like Differences and DerivativeFilter (thanks Jens). In fact, the derivative operation is a kind of high-pass filter, which will augment the noise and remove the low frequencies. You can listen to the changed sound using SampledSoundFunction or by saving the result out to a .wav file using Export. There are plenty of other ways you can manipulate the sound: LowpassFilter and HighpassFilter come to mind.

share|improve this answer
    
Don't forget DerivativeFilter for lists. –  Jens Jun 9 '13 at 16:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.