Audio in to zero-crossing...

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Another small question if I may...

I want to take an audio signal into a zero-crossing detector, i.e. to signal condition the drive (from an MP3 player typically) then to feed into a ZCS detector using an ATmega which I will use to generate a square wave with leading edge on the -ve -> +ve input transition, and the trailing edge on the +ve -> -ve input transition.

I was wondering if companding the input would be worth while?

Can anyone suggest suitable approaches - the obvious one is to use the comparator, but I was wondering if there are any other approaches I should look at.

Thanks

Nicko

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Use the built-in comparator.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could consider an all-analog solution, a clipping amplifier.

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Comparator.

But mind the frequency content of the analog signal before "polling" it in the MCU, else you could miss them, ie use a low pass filter before the MCU.

Btw, the MP3 compression does not preserve the phase information.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If a low pass filter is used before MCU, how it is supposed to see zero crossings of a high frequency signal then?

Anyway, what do you do with the zero cross detected signal? I guess you need some hysteresis too?

I think normally it is sufficient to know when the signal amplitude is low enough to change volume etc, but usually there is some hardware that holds the new volume value from micro and then latches it forward at zero cross or sufficient timeout if zero cross does not happen soon.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jepael wrote:
If a low pass filter is used before MCU, how it is supposed to see zero crossings of a high frequency signal then?

What is high frequency? What about using a cutoff frequency at 30 or 40 kHz for the audio signal? If you programmed an interrupt and disconnected the source the comparator would happily trigger it at "infinite" rate.

Quote:

Anyway, what do you do with the zero cross detected signal? I guess you need some hysteresis too?

I think normally it is sufficient to know when the signal amplitude is low enough to change volume etc, but usually there is some hardware that holds the new volume value from micro and then latches it forward at zero cross or sufficient timeout if zero cross does not happen soon.

I agree about the hysteresis, but how can it be configured when you have no direct access to the comparator output?

Suggestion: external comparator with hysteresis configuration. This one has an opamp too:

http://www.national.com/mpf/LM/L...