Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
General Math
Calculus
Differential Equations
Topology and Analysis
Linear and Abstract Algebra
Differential Geometry
Set Theory, Logic, Probability, Statistics
MATLAB, Maple, Mathematica, LaTeX
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
General Math
Calculus
Differential Equations
Topology and Analysis
Linear and Abstract Algebra
Differential Geometry
Set Theory, Logic, Probability, Statistics
MATLAB, Maple, Mathematica, LaTeX
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Mathematics
General Math
Fourier Analysis on musical chords in different instruments
Reply to thread
Message
[QUOTE="jedishrfu, post: 6608065, member: 376845"] Some years ago, my summer students did a project detecting gunshots from sound clips. They used Processing and the Minim library. There was an application in Minim that performed FFT and displayed the audio frequency spectrum. [URL]https://code.compartmental.net/minim/index.html[/URL] [URL]https://processing.org/[/URL] Here's an example from Minim that computes and displays a dynamic frequency spectrum: [code=java] /** * This sketch demonstrates how to use an FFT to analyze * the audio being generated by an AudioPlayer. * <p> * FFT stands for Fast Fourier Transform, which is a * method of analyzing audio that allows you to visualize * the frequency content of a signal. You've seen * visualizations like this before in music players * and car stereos. * <p> * For more information about Minim and additional features, * visit http://code.compartmental.net/minim/ */ import ddf.minim.analysis.*; import ddf.minim.*; Minim minim; AudioPlayer jingle; FFT fft; void setup() { size(512, 200, P3D); minim = new Minim(this); // specify that we want the audio buffers of the AudioPlayer // to be 1024 samples long because our FFT needs to have // a power-of-two buffer size and this is a good size. jingle = minim.loadFile("jingle.mp3", 1024); // loop the file indefinitely jingle.loop(); // create an FFT object that has a time-domain buffer // the same size as jingle's sample buffer // note that this needs to be a power of two // and that it means the size of the spectrum will be half as large. fft = new FFT( jingle.bufferSize(), jingle.sampleRate() ); } void draw() { background(0); stroke(255); // perform a forward FFT on the samples in jingle's mix buffer, // which contains the mix of both the left and right channels of the file fft.forward( jingle.mix ); for(int i = 0; i < fft.specSize(); i++) { // draw the line for frequency band i, scaling it up a bit so we can see it line( i, height, i, height - fft.getBand(i)*8 ); } } [/code] You can find this sample in the Minim library of examples when running the Processing IDE, using the IDE to download Minim, and checking out the examples menuitem from the File menu. Under Minim FFT, look for AnalyzeSound. I know there is a more sophisticated app written by David Sanz Kirbis for plotting an FFT spectrum for Android showing the spectrum in a graph with properly labeled axes but I'm at a loss to locate it. POST SCRIPT -- However, I think this is it: [URL]http://www.therandomlab.com/2013/05/fft-audio-frequency-analysis-with.html[/URL] [/QUOTE]
Insert quotes…
Post reply
Forums
Mathematics
General Math
Fourier Analysis on musical chords in different instruments
Back
Top