View previous topic :: View next topic |
Author |
Message |
nuno12345
Joined: 16 Jul 2008 Posts: 50
|
Song peak detection (bpm counter) |
Posted: Sat Aug 15, 2009 11:45 am |
|
|
Hello, I'm trying to develop a BPM counter for music beatmatching but I can't find references anywhere so I started a new thread.
My guess is that I've to make a lowfreq filter first for "beat" detection, then detect each peak and the time between those peaks.
Any help?
Thanks |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Thu Aug 20, 2009 1:46 am |
|
|
I did something similar recently. (VU meter. Fun!)
Do you have your filter/peak detector circuit yet?
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
nuno12345
Joined: 16 Jul 2008 Posts: 50
|
|
Posted: Tue Aug 25, 2009 8:31 pm |
|
|
well i think for filter we can simply use an RC circuit, low pass filter quite simple....dont have a peak detector but probably i can use ADC right? |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Tue Aug 25, 2009 11:02 pm |
|
|
I would make sure to use a good low pass with an op-amp.
You'll need the drive of an op-amp to make most ADC's happy.
If you look on Microchip's website, they have a free download for a "filter designer" called FilterLab.
In a sense, you could just as easily use a peak detector on a comparator as you could an ADC to figure out at what point you have what level.
But either way, you still need to start with a good filter that takes out the stuff that can interfere with the signal you want to measure.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
vascotech88
Joined: 10 Mar 2009 Posts: 33 Location: Aveiro, Portugal / Lodz, Polska
|
|
Posted: Wed Jul 07, 2010 9:21 am |
|
|
Anyone found solution already? |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Wed Jul 07, 2010 2:04 pm |
|
|
I did a peak detector for another project (the VU meter) that worked quite nice.
The software just drives a VU display though.. it's not trying to detect peaks.
So I don't know if that's a solution for you.
I used a low-pass filter with an active rectifier.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
vascotech88
Joined: 10 Mar 2009 Posts: 33 Location: Aveiro, Portugal / Lodz, Polska
|
|
Posted: Wed Jul 07, 2010 2:17 pm |
|
|
Hello, again.
After this post here today, i started working in MATLAB to test some filter and peak detections and later write in C and put in a PIC.
My idea is this:
-We have a sound from 0~20KHz
-Since we need to detect beats, we need only arround 500Hz of max frequency.
-In my case, i will use 2KHz of ADC conversion frequency in the PIC, which will make 1KHz of max frequency, and its enough
-Then i will make a simple convultion filter with 16 points, wich is enough to not start having echo after the calculations
-Then we can apply to all points: x^4
-Then we just need a threshold value
-After... well i will do tomorrow, but we need to filter the beats, give some time to wait for the next one, and measures, automatic gain and so on...
(NOTE: Of course we need normalizations and so on... i added them in the matlab file)
(NOTE2: I am just planing to use a voltage divider, condensator and 2 resistors to put mean value of sound in 0.25V)
Picture here:
|
|
|
vascotech88
Joined: 10 Mar 2009 Posts: 33 Location: Aveiro, Portugal / Lodz, Polska
|
|
Posted: Wed Jul 07, 2010 3:34 pm |
|
|
I forgot to tell, the song is Into The Future (The Aston Shuffle Remix) :P |
|
|
vascotech88
Joined: 10 Mar 2009 Posts: 33 Location: Aveiro, Portugal / Lodz, Polska
|
|
Posted: Wed Jul 07, 2010 4:23 pm |
|
|
Here I am back again.
I made some tests in Proteus about the input circuit... At a first approach I didn't want to use opamps and so on, yes, you may ask about the input power, well this circuit is to work with high sound power, not a regular headphones output. That's why the idea of the voltage divider. Anyway, after some mins playing with Proteus I got this:
|
|
|
vascotech88
Joined: 10 Mar 2009 Posts: 33 Location: Aveiro, Portugal / Lodz, Polska
|
|
Posted: Thu Jul 08, 2010 5:22 am |
|
|
Finally i spent some more time improving the MATLAB C file.
Its not finished yet:
> I need to make the auto gain code, which is not easy to make in MATLAB because i am not running in real-time, but i will try.
Here is the latest picture:
I will upload the files soon _________________ -----
Vasco Jose Dias Baptista
http://vascotech88.pt.vu/ |
|
|
vascotech88
Joined: 10 Mar 2009 Posts: 33 Location: Aveiro, Portugal / Lodz, Polska
|
|
|
vascotech88
Joined: 10 Mar 2009 Posts: 33 Location: Aveiro, Portugal / Lodz, Polska
|
|
Posted: Thu Aug 19, 2010 5:40 am |
|
|
CHeck my website, i made the first working prototype (more or less) :p _________________ -----
Vasco Jose Dias Baptista
http://vascotech88.pt.vu/ |
|
|
|