Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Audio beat detection

Status
Not open for further replies.

jrz126

Active Member
I've got another question that applies to my Roof LED's...again heres the backround on it...the leds are controlled by 8 bit shift registers with transistor arrays connected to the 8 outputs to provide the high current. I then control the shift in bit and clock bit using a couple 4017 Counters (used as a frequency divider). The clocks of the counters are controlled by a LM3915 VU meter IC which is connected to my subwoofer amp. So the LEDs change with the music.

The problem is, on the long bass notes, the leds are constantly changing. Now what I'm looking for is a somewhat accurate beat detection.

Here's what I'm thinking about doing:
Still using a low pass filter (subwoofer amp), I'd full-wave rectify the voltage through some diodes, and add a smoothing cap. I'd then take this D.C. signal and pass it through a differentiator op-amp. Then I'd use another circuit that would take the op amp output and convert it to either a 5V or 0V signal for my clock.
Would this work?

Anyone have any suggestions on a better way to accomplish this? (avoiding the microcontroller if all possible).
 
jrz126 said:
Here's what I'm thinking about doing:
Still using a low pass filter (subwoofer amp), I'd full-wave rectify the voltage through some diodes, and add a smoothing cap. I'd then take this D.C. signal and pass it through a differentiator op-amp. Then I'd use another circuit that would take the op amp output and convert it to either a 5V or 0V signal for my clock
Adding smoothing would defeat the object.
Pass the unsmoothed waveform to a squarer to get fast edges and send them to your clock generator.
 
Hi Jrz,
I don't know why you have shift registers when the "stepping" action of a 4017's outputs is like a shift register.
1) Do you want the stepping action to occur on each beat of the music?
Now maybe it is stepping to each cycle of the frequencies in the music. Then to detect each beat you can make an envelope detector circuit with a resistor and rectifier charging a capacitor. The capacitor and its charge and discharge resistors values detrmine how much filtering of the cycles occurs. Its output can be squared with an opamp or Cmos Schmitt-trigger and used to clock a 4017 stepper.
2) Do you want waves of LEDs to occur with each beat?
Then amplify the outputs of the LM3915 VU meter with transistors driving rows of LEDs.
 
I guess I need to clarify alittle more. I'm using the 4017 as a frequency divider, the clock of the 4017 is connected to the output of my LM3915. Then I use a single output of the 4017 and connect that to all of the clocks of my shift registers.

My thinking behind the DC rectification was that for the long bass notes, the DC voltage would remain somewhat constant, then whenever this note changes amplitude, the DC voltage would also change. I'd then have a differentiator op amp detect this change, which would then control my circuit. I'm not quite sure how I'd go from the differentior to my circuit just yet, but I wanted to see what you guys thought about my plan thus far.
 
I'm Thinking what your doing is Really Strange.

From your Explainations, I'm Not sure What Exactially your trying to acomplish?

How about a Better Explaination?
Also a Block Diagram would be useful.
 
Hi Jeff,
Very confusing.
The LM3915 is already a rectifier, a very good one with no rectifier voltage drop. Its output pulses positive for each cycle of every frequency, unless it has a rectifier and filter cap feeding it.
When the volume of the signal is loud enough to activate an output of the LM3915, it will clock the 4017 that divides by 5 or 10. The 4017 clocks a shift register that divides the frequency more?

A continuous 80Hz comes along and the shift register steps its outputs at 1 or 2 steps per second?

I think you want the brightness of the LEDs to be modulated by the music, not just the stepping frequency. You can do both if you want.
 
Hi,

"I'm Not sure What Exactially your trying to acomplish?"

Well, i looked at the little video snips,
and i think its a light display inside the roof space or ceiling space
of a music practice/performance area using extra-bright LEDs.

And very nice it looks too.

He is probably trying to achieve various visual effects related to
various frequencies of notes/music.

What he has done so far looks very good.

Regards, John :)
 
How do I view the videos? When I click on the Putfile, I get to the page that says to be patient, it is loading, but my browser isn't loading anything.
 
audioguru said:
A continuous 80Hz comes along and the shift register steps its outputs at 1 or 2 steps per second?

Thats exactly what happens, when I'm playing some rock music, or some rap with constant bass, even though there is a noticable beat in the song, the lights are constantly changing. I'm trying to get them to change with the beat.

You should just be able to click the putfile link in my sig. I'll try to upload some videos somewhere else later tongiht.

John1, These LED's are actually in the head liner of my car :)

I'll try to draw up a block diagram tonight as well.

Thanks for your help,
Jeff
 
Ok, I got a picture. Now I'm thinking if I pass the signal through the bandpass filter, (I've checked a couple of songs, most of them seem to have a noticble beat in that freq. range). Then pass the signal through a differentiator, (to detect the sharp spikes of the beat), then I'd somehow convert the output of the differentiator to drive my clock signal.
 

Attachments

  • signal_eto.jpg
    signal_eto.jpg
    65.6 KB · Views: 897
Hi Jeff,
You haven't posted a schematic of what you have, and your putfiles don't work, so I am just guessing.
If you want the LEDs to step forward one row for each bass beat of the music, then you don't want to divide the output of the LM3915 with a 4017 divider.

What about the LM3915:
1) Isn't it displaying the bandpass filtered output of the subwoofer amp?
2) Doesn't its output display the music's beat?
3) Is its input direct, so that its output is each cycle of the bass, or is the input made with a half-wave peak detector like in the datasheet? Then the output of the LM3915 would be pulses of the beat with fast edges to clock the shift-registers. The output of the LM3915 that you use for an output would need a pull-up resistor to be a logic clock.
 

Attachments

  • lm3915_input.gif
    lm3915_input.gif
    7.9 KB · Views: 1,014
he wants something to switch the lights everytime the audio wave hits the red line ( shown in picture).

But with out a smoothing capacitor the lights might switch say 8 times every beat, instead of the desired 1 beat, 1 light switch.

What I would recommend is something like a 555 in a monostable setup. Once an 80 hertz wave trips the 555 timer, it's output stays high for a set amount of time ( eg. 150 ms). And then resets waiting for the next drum beat to set it off again. I'm only guessing 150ms, but that depends on how long the 80 hertz wave lasts and what kind of music you listen to.

this delay of 150ms means that it cant be tripped again for 150 ms. So you cant get 8 switchs in a beat, only 1 switch ( provided the beat doesn't last longer than 150 ms)
 

Attachments

  • wave_chopper-1.jpg
    wave_chopper-1.jpg
    17.9 KB · Views: 787
I have never heard bass make 8 pulses during one musical beat except in a video with sound effects. Two or three maybe: boom-boom pause, boom-boom pause etc. Let the LEDs follow it, it will look cool. :lol:

Hey Jeff,
Isn't your LM3915 indicating the beat?
 
No it isnt following the beat, the pattern changes with respect to the frequency, say there is a constant 80 Hz with the beats mixed in, the leds will keep changing WRT to the 80Hz, you cant 'see' the beats.

I'm already using that half wave rectifier too.

Thanks Pike, thats exactly what I want to do. I'll give it a try when I get out of work.
 
Hi Jeff,
If there is a trigger input to a 555 just before (within 10us) and when it is supposed to time-out, it won't time out. It might cause the LEDs to appear more random than now.

Usually the beat is at a higher level than any bass, unless the amp is clipping all the time. All LM3915 circuits with the half-wave rectifier that I've seen and built display the beat, especially the one for the subwoofer. Maybe you don't have the filter cap at the output of the half-wave rectifier since you say the LEDs keep changing during a long bass tone.

It doesn't make sense. You have a half-wave rectifier with a 1/10th of a second filter feeding an LM3915 level sensor, clocking a 4017 divide-by-ten. Therefore the shift-register should shift only once for every ten loud bass tones, and shift only once for every ten beats.

No schematic?
No video?
 
ok, lets see if this works...I cant tell because the filter at work blocks the webpage. but this is a constant 30hz tone **broken link removed**

As for the smoothing cap, it's quite possible that I didnt include it. I'll have to get back to you on the schematic, I've made so many changes to my circuit so any current schematic I have is incorrect.

EDIT: I'm running my circuit off a regulated 5V supply? I'm not sure of the exact voltage, but it's quite possible that the signal input could be larger than 5V. I have a transformer connected to the amp output to isolate the audio signal going to my circuit, I'm not sure if it is a 1:1 or not.
 
Hi Jeff,
Thanks for the cool video. :lol:
It looks like the shift-registers are clocked by the 30Hz directly, and there isn't a filter to recover the beat.
If I was doing it, I would filter the half-wave rectifier to recover the beat, and use it as a reference for a Phase-locked-loop with a divide by-16 counter in it so its output will clock the shift-registers with one full rotation per beat. Then I would use the envelope at the half-wave rectifier to amplitude-modulate the brightness of the LEDs.
The LEDs would light very brightly on the forward spoke of the wheel for each beat and the remaining spokes would gradually dim as they step around.
Don't you get dizzy? :lol:
 
thats an older video. Right now I have the data input to the SR connected to another 4017 counter, which is set to reset when it counts to 5 or something, so that way it lights up a single line 8 leds across, and that spins around.

That sounds pretty cool, but you kinda lost me with the PLL :? .

I dont get dizzy, and I get to watch them in my rear view mirror :D So I can enjoy my work and not get too distracted.
 
You kinda lost me with your input that might be clipping, an LM3915 that I don't know what it is doing or displaying, a couple of 4017 counters that might be dividing the audio frequencies and a couple of shift registers that are shifting who knows what! :lol: :lol:

A PLL can be used to sync its oscillator on a multiple frequency of the beat. Then its oscillator can be used to clock the shift-register so that one full rotation is in sync with the beat. I might try it with my chasers.
 
audioguru said:
You kinda lost me with your input that might be clipping, an LM3915 that I don't know what it is doing or displaying, a couple of 4017 counters that might be dividing the audio frequencies and a couple of shift registers that are shifting who knows what! :lol: :lol:

:lol: That is very funny! and that pretty much sums up the explaination I've been giving you. I've been thinking/working on this project since about October, so I just think everything is common sense...I'm sorry for my half assed attemt of explaining it.

Looks like I'm going to be looking into PLL's in the near future.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top