Silence detection from high level car speaker output

Thread Starter

MrAlfred

Joined Jan 6, 2017
4
Background:
I am designing a circuit that should tap the car stereo speaker cable and detect a morse-code like tone signature. The circuit has a micro controller (with ADC) and should detect when a audio signal is present and when there is silence. It is important that the signal tapping is undetectable, not disturbing the audio signal going to the speakers. The gain of the signal can vary as the user turns the head unit volume up or down. The circuit should be suitable for different head units.

These are the different alternatives I've found so far:
  • Use simple voltage divider and feed the attenuated audio signal into the ADC. As far as I know most car head units have bridged outputs, making this solution unsuitable. In addition, head units differ in power output, making it difficult to make a solution that fits all.
  • Use transformer to attenuate the signal and feed this signal into the ADC. This should be possible, and would work as the common line level converters that are sold in car audio shops.
I'm hoping that some of you know of a simpler solution, as I only need to detect the presence of an audio signal.
 

#12

Joined Nov 30, 2010
18,224
Not much information given. Audio signals can vary in voltage by a range of 10,000 to 1.
Why is something in that range different from a, "morse-code like tone signature" while, "The gain of the signal can vary as the user turns the head unit volume up or down." ?
How do you define, "silence" in the presence of this "morse-code like tone signature"?

"a micro controller (with ADC)" Why do you need to know the exact amplitude, and how exact should it be?
Is the measurement relative or absolute?

There are many ways to detect the presence or absence of a signal, but first, you have to define the signal.

"The gain of the signal can vary as the user turns the head unit volume up or down. The circuit should be suitable for different head units."

So, a Universal detector of some signal in the absence of a multitude of other possible signals for all applications of car stereo, regardless of their power level, except it is during "silence".

Please try to clarify your needs.
 

Thread Starter

MrAlfred

Joined Jan 6, 2017
4
Sorry for not being more specific, I am a novice when it comes to analog circuits. But please bear with me, I will try to explain a bit more :)

The signal going out off the head unit will alternate between a fixed tone and silence, forcing a morse signal. I thought that when nothing is heared from the speakers, the current going to them will be 0? So if the signal was fed into an ADC I would expect to read 0 at silence and some number when the tone is played, but this is maybe wrong?

The statement regarding gain was to indicate that the amplitude of the tone is not fixed, but will vary.

I absolutely don't need to know the amplitude of the signal, I only mentioned ADC since the microcontroller I use has this feature and maybe there is a smart way to use it to solve the problem :)

Unfortunately, I am uncertain what the peak to peak voltage of normal car audio are, but from what I've read a 15w output to a 4ohm speaker should be ~25v peak to peak.
 

#12

Joined Nov 30, 2010
18,224
Let's try some more education. A fixed frequency tone can be selected rather well. Do you know the frequency of this "fixed tone"? Is there a definite pattern? What amounts of time are involved? A few milliseconds? A whole second? What amount of time is involved with the "silent" times? What is the difference in amplitude between the "tone" and the "silence"?

Finding a zero voltage level in an audio system needs some kind of limit.
For example, my living room speakers deliver 102 db SPL at 1 meter with one watt of power.
That would be p=E^2/8 ohms =.353 V RMS or 0.5 volts peak.
If the sound I want is half as loud as a strong, clear, conversational voice at 2 feet of distance, that's 60 db SPL
-42 db = 20 log (base 10)[V2/V1] = 0.004 volts peak.
and I'm not even close to, "silent".

See the difficulty of picking out a voltage level that is, "zero"?

If you say what you need, instead of what you want, this often gets a lot simpler.
Right now, we're "playing 20 questions" because you don't have an educational basis in audio or analog.
Right after that, I am incompetent in the use of a microprocessor, so we need at least one more person to get involved.
I doubt that person will step up until you have provided enough information to define your goal.
So, what are you trying to do? Blink an LED between songs? Insert next CD when the output becomes a marker signal?
Back up to the basics. I think you have run off down the wrong path.
If you haven't, that's fine, but electronics requires at least a little bit of hard facts which can be expressed as numbers.
 
Last edited:

GopherT

Joined Nov 23, 2012
8,009
@MrAlfred

You can try something like this. A self-resetting peak detector (actually an envelope filter). The operational amplifier actually attenuates but is used to prevent any signal (speaker) interference.

The output if the filter should be zero about 0.2 to 0.4 seconds after silence. if you want faster, make ether the R or C by the output proportionally smaller values.

The two signal sources, 50 mOhm resistors and speaker represent your head unit as a full bridge +12v - +12v amp.

Output to the ADC should be 0 to 3.5 V or so. An LM358 or LM324 should be fine. It should be an op amp that can have output all the way to zero volts (not possible for all op amps).

You can decide in software what "silence" is by the ADC value. Note, however, that an unpowered speaker that is bouncing around while driving can generate a voltage (just like a motor can generate a voltage when an outside force spins it.


image.png
 

AnalogKid

Joined Aug 1, 2013
10,987
Use simple voltage divider and feed the attenuated audio signal into the ADC. As far as I know most car head units have bridged outputs, making this solution unsuitable..
Bridged, yes. Unsuitable - no.

The two outputs in a single bridged signal are identical, but one is inverted with respect to the other. So each one contains 100% of the signal information, 100% of it's voltage amplitude with respect to GND. Any amplifier or network with an input impedance greater than a few kilohms (10K is a nice round number) will not load the signal appreciably.

Also, the signal will not be 0 V when there is no audio. All signals have noise, and the noise doesn't go away completely when the signal is turned down. Better to have a finite detection threshold, and anything below that is "off". It is relatively easy to have a threshold that tracks as a percentage of the amplitude of the signal. In this way, when the amp is turned up and the noise level is relatively high, the detection threshold also goes up to ignore it.

ak
 
Last edited:

#12

Joined Nov 30, 2010
18,224
Both of those guys are good designers with good ideas. I am confused by the, "morse-code" like signal. Why is it there? Is that what you want to detect? Or is it something simpler and you just added that signal because you thought it was necessary?
I have done circuits with two time constants that would seem like, "recently" and, "now". That isn't much of a problem.
I would also mention an AGC circuit which resembles what Gopher said, but that one isn't simple.

The more you tell us, the better we can arrive at the goal with the minimum of complication.
 

shortbus

Joined Sep 30, 2009
10,045
Both of those guys are good designers with good ideas. I am confused by the, "morse-code" like signal. Why is it there? Is that what you want to detect? Or is it something simpler and you just added that signal because you thought it was necessary?
I have done circuits with two time constants that would seem like, "recently" and, "now". That isn't much of a problem.
I would also mention an AGC circuit which resembles what Gopher said, but that one isn't simple.

The more you tell us, the better we can arrive at the goal with the minimum of complication.
To detect the hidden messages in music. It is there you know.
 

dannyf

Joined Sep 13, 2015
2,197
detect a morse-code like tone signature. The circuit has a micro controller (with ADC) and should detect when a audio signal is present and when there is silence. It is important that the signal tapping is undetectable
sounds like you are trying to detect an undetectable signal -> tough luck with that.

to the extent that you want to detect a pattern of a particular tone, that's fairly easy: make an amplifier of a specific tone and make it generate a 0/1 signal to be detected by the mcu.

that's how IR remotes work.
 

Thread Starter

MrAlfred

Joined Jan 6, 2017
4
It really seems like I have to improve my explaining skills. At least when I am trying to explain something that I don't understand ;)
Thank you for the replies so far and your interest in solving this issue for me. Get some popcorn and I will give you the full story.

As you know, commercial radio broadcasters get paid by advertisers based on how many people that listen to the station when the advertisement is sent. The more people that listen, the more it costs. To determine the market penetration of each radio station, media measurement companies like Kantar do a lot of interviews with a representative group of the population. This way they determine statistically how many people that listen to each radio station.

For TV, the picture is a bit different. At least in some countries, a representative group of people get paid to have a special decoder box that detects the channels the user is watching and transmit this information to the media measurement company. This gives much more accurate statistics, and it is possible to get market penetration statistics for a separate show immediately.

Now it seems like there is an interest in doing the same thing for car radios, ie. paying a representative part of the population to install a radio recognition box in the car that detects which radio station that the user has tuned to. This information is sent to the media measurement company through a 2G/3G/4G modem installed in the box. At the moment I am developing a proof of concept of this idea, just to see if it is technically feasible to do this. I'm not getting paid to do this, it is just a hobby project as of now.

The concept of channel detection:
  1. Broadcasted signature: Every radio broadcaster should transmit a special audio signature from time to time. It could be transmitted in front of every commercial break for instance. The audio signature should be short, easy to detect and false detects should be at a minimum. The best solution would be to have an audio watermark (like www.intrasonics.com ), but for this prototype I will have to stick to an audible signature. To avoid false detects in normal music, I was thinking to use a on-off coded signal, or maybe switching between two tones creating an unique signature. For my proof of concept I will use low power FM transmitters to simulate the broadcasters, which mean that the tone signature can be any frequency that I select. For instance I could use dual tone multi frequency (DTMF) tones. The signature can be created by varying tone frequency and tone duration. In my first post I stated that I only needed to detect presence of any signal because I thought that would lead to an easier solution. But detecting the frequency as well is preferable.

  2. Detection circuit: As you may have noticed, I'm not an electrical engineer. I am a programmer, working with micro-controllers in my day job. If the speaker signal is digitized, I think I will be able to write an algorithm that recognizes a set of predefined frequencies and the duration of such tones. The micro-controller I am using (STM32) has a 12 bit ADC with an input range of 0-3.3V. I don't HAVE to use the ADC, but it's there if it makes the solution easier. For instance, I could use the aforementioned NJM2072 or a special DTMF-decoder IC like HT9170. The common characteristics for both ADC, NJM2072 (0-7V input) and HT9170 (-0.3 - 0.3V input) is that they only tolerate low voltage input signals. So the detection can either be done in software if the full signal reaches the ADC, or in a separate circuit that feeds a digital signal to the micro-controller when a specific tone/"silence" is detected.

  3. High level to low level converter: This is where I am stuck and need your advice. I need to design a circuit that can be connected to most car head units, and that will convert the possibly high voltage speaker signal to something that the micro-controller can interpret as a tone signature. As explained in 2, either as a full signal to the ADC, or as a digital signal indicating that a specific tone (or "silence") has been detected. This circuit will always be connected, so it should not disturb the audio signal going to the speaker in any way. I will look into the suggestion so far (Thanks GopherT and dannyf), but please let me know if you have other suggestions of how this can be done.
tone_signature_detector.png
 
Last edited:

dannyf

Joined Sep 13, 2015
2,197
RDS (or HD radio equivalent) would be the best bet as it does not degrade the audio.

If you have to do it through audio, your carrier may be outside of the audio band (but it has its own problems) so that the signal itself is inaudible.

the signal could be "AF" amplitude modulated, meaning that if you pick (for argument sake) 16Khz as your carrier and all your decoder does is to detect the presence of that 16Khz signal.

You can define your protocol for '0', '1' or some other signatures. and there should be a framing signal as well. This type of scheme is fairly common - radio clocks do that for example.

I guess my answer is that it is doable but not terribly practical.
 

#12

Joined Nov 30, 2010
18,224
This looks a lot easier than it did yesterday. If you can get all broadcasters to send a signal, you can fit an identifying string into a few milliseconds. Program to look for the start sequence, then record the identity characters.

Code:
If 101011011, then record a 16 digit broadcaster ID code
Otherwise, keep waiting to detect the sequence.

24 bits at 10KHz costs 2.4 milliseconds to identify any of 65536 broadcasters. A human wouldn't notice anything but a very short chirp.
Smarter people than I could describe a way to do it even better than that.

And we can start with an AGC circuit. This one would set anything from millivolts to 20 volts to the right amplitude.
Again, some modifications should be necessary.

And I don't even know whether all broadcasters already transmit an identity code!

Remember, this is only one opinion, and it's a half-baked idea.

ps, Did I mention frequency shift keying or phase shift keying? You don't need a zero amplitude specification for that. All this crap about detecting amplitude levels was a giant waste of time.
 

Attachments

Last edited:

GopherT

Joined Nov 23, 2012
8,009
If you have 2G/3G/4G modem, why would you need anything more than a microphone?

The 2G/3G/4G device can have a small recorder that, once it detects the audio sequense described by @#12, the device will parse the morse code signal (as audio) and send to the base station via 2G/3G/4G. It will essentially behave like an Amazon Echo that waits for the radio station pulse sequense (instead of "Alexia").

Nobody will want to wire this device to their stereo. In fact, your whole idea could be implemneted as an iphone app.

Good luck.
 
Top