Solved

Beat-Counting

Posted on 1998-06-30
7
228 Views
Last Modified: 2010-04-10
Does anyone how I can implement Beat-Counting (let my program 'know' wether or not there is a beat at a certain moment and determin the amount of this per minute) if I have acces to fft and pcm data (real-time).
0
Comment
Question by:Odie
7 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 100 total points
ID: 1166973
I've not done this in software but have done it in hardware.  I once built a light system for a dance floor and the requirement was to index a series of lights once for every beat of the music.  I built a low pass filter that rolled off sharply above 100Hz.  This then went to an integrator that needed a signal for about 0.125 seconds before triggering it's output.  This output went to a flip-flop circuit that performed a divide-by-2 function (it looked better to do every other beat that every one).  

Since you are doing this in software and you have the fft, it should be a easy task to run this filter and make it work.  You can even add adaptive features so that as the music changes it can "search" different frequencies and windows for a beat if the default one is lost.
0
 

Expert Comment

by:overworked
ID: 1166974
I'm very interested in doing the same thing in my app SuperSonic. If you come up with a successful beat counting routine, would you be willing to put it in a dll and license it to me?

-Rob
rob@gosupersonic.com
http://www.gosupersonic.com

0
 
LVL 1

Author Comment

by:Odie
ID: 1166975
Overworked,

No problem
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Author Comment

by:Odie
ID: 1166976
JHance,

Could you explain that a little more detailed?

I know I have to search for "pulses" in the lower fft-values, but could you be a little more specific in your explanation?  How do I do this?
0
 
LVL 32

Expert Comment

by:jhance
ID: 1166977
You pick you range of frequencies and then watch for the presence of a signal for a given time period.  For example, let's say you have broken down your input signal using a FFT into 3 bands, 20-200Hz, 200-2000Hz, and 2000-20000Hz and the values are normalized to 8-bits.  Now your software can "watch" the 20-200Hz band for a signal above a threshold that is present for "X" mS.  After that time, you assume that there is a beat.  Then you wait for it to go away for "X" mS.  Now you assume that the beat is over.
0
 
LVL 84

Expert Comment

by:ozo
ID: 1166978
I might have been inclined to look for peaks in the residuals from the Linear Prediction Coefficients
But windowed pulses in low FFT bands sounds lika promising idea too.
0
 
LVL 1

Author Comment

by:Odie
ID: 1166979
JHance,

I'm nearly ready with implementing your method.


Ozo,

Could you explain that Linear Prediction Coefficient stuff a little more.  I might want to implement different methods to make sure I'm counting beats (and not noise or something).

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now