Interpreting Data From an Audio Signal

I have a super simple circuit modeled after this:GitHub - markqvist/MicroModem: Atmega328p-based 1200 Baud AFSK radio modem
I have no need for sending data, only receiving, so I only made this piece of the schematic:

While testing the circuit, I noticed that changing the line in voltage from +5 to 0 only causes a change of 0.05 volts on the signal. This was designed for interpreting the audio signal on a handheld radio. I have the same radio and I have found that the signal ranges from 0 to +4v. How does this circuit work if the signal is diluted to almost nothing? Why not simply wire the audio signal directly to an analog pin? Or even better, why not wire the signal output directly to a serial pin and have it print directly to the serial monitor?

Line Level
LINE LEVEL

Line level is a standard . If you are truly using line level it will conform to the standard. What instrument are you using to measure the voltage ?

Your questions are "inexperienced".
You obviously CANNOT wire the signal directly to an analog pin for obvious reasons
Wiring an audio signal ti a serial pin to print the output is just off the deep end.
You're joking , right ?

griffin175:
I have a super simple circuit modeled after this:GitHub - markqvist/MicroModem: Atmega328p-based 1200 Baud AFSK radio modem
I have no need for sending data, only receiving, so I only made this piece of the schematic:

While testing the circuit, I noticed that changing the line in voltage from +5 to 0 only causes a change of 0.05 volts on the signal. This was designed for interpreting the audio signal on a handheld radio. I have the same radio and I have found that the signal ranges from 0 to +4v. How does this circuit work if the signal is diluted to almost nothing? Why not simply wire the audio signal directly to an analog pin? Or even better, why not wire the signal output directly to a serial pin and have it print directly to the serial monitor?

Your circuit seems to be a simple high pass filter with a pullup on the output. The output is not always "diluted to nothing" unless your AC input in not very strong or is comprised of mostly low frequency sine waves.

Take 2 seconds and google line level definition and you'll find this:

"A device that operates at line level either has a very strong output signal, or only functions properly when you feed a very strong signal into it."

raschemmel:
Line Level
LINE LEVEL

Line level is a standard . If you are truly using line level it will conform to the standard. What instrument are you using to measure the voltage ?

I was using a multimeter to measure the signal voltage (I know, it averages). I figured it was just a standard audio signal, since it works fine with any headphones. Judging by that, the reading appeared to make sense.

I suppose the voltage probably oscillates from positive to negative, and not 0 and up. The meter definitely wouldn't be able to pick that up.

My assumption was that LINE LEVEL was just like a data signal, only analog. I understand what went wrong now.

raschemmel:
Line Level
LINE LEVEL

Line level is a standard . If you are truly using line level it will conform to the standard. What instrument are you using to measure the voltage ?

Your questions are "inexperienced".
You obviously CANNOT wire the signal directly to an analog pin forobvikus reasons
Wiring an audio signal ti a serial pin to print the output is just off the dedp end.
You're joking , right ?

These questions were rhetorical. Obviously it would be a bad idea to connect the signal directly to a pin like that. I was curious as to the differences between the signals. I should have been more specific.

Even if I was being literal, why does everyone respond so rudely to stupid questions? This is a forum for questions to ask the more experienced... isn't it? A dumb question to you may be a genuine curiosity which someone of less experience may not know how to start to researching such a thing. Please be respectful.

Hi, The circuit you showed has two equal value resistors from 5V to ground, so the DC input to A0 is 5/2 = 2.5V. Then the AC signal, coupled through the capacitor, is centered on 2.5V.

This is a typical way to handle AC signals as input to Arduino.

These questions were rhetorical. Obviously it would be a bad idea to connect the signal directly to a pin like that. I was curious as to the differences between the signals. I should have been more specific.

Even if I was being literal, why does everyone respond so rudely to stupid questions? This is a forum for questions to ask the more experienced... isn't it? A dumb question to you may be a genuine curiosity which someone of less experience may not know how to start to researching such a thing. Please be respectful.

Let's not exagerate. No one was rude. If you are offended by someone telling you that you are inexperienced when you post on the forum with a stupid question then you should post somewhere where they are afraid to tell you the truth. Our job here is to tell you the truth , the whole truth and nothing but the truth. The truth is you are inexperienced . You know that , I know that, and now the whole world knows that. Is that a problem ? (not for me , is it one for you ?) If you had researched your topic on Google we wouldn't be having this conversation. Next time Google your topic first.
Ok, let's talk about teaching techniques first and then get to the questions. If you are in a class in a college, with a well known respected professor, (let's say, for example, one who did consulting for NASA for the Apollo missions) , how would you expect him to respond to a stupid question ? Why is the forum any different ? Do you think that just because you CAN ask stupid questions that you SHOULD ?
What kind of mentors would we be if we let you get away with being stupid , huh ?
We are supposed to teach you how to teach yourself, not how to ask us. We are supposed to teach you how to NOT ask stupid questions.
If you post on the forum , you are posting in a place where the experience of the members who are going to answer your question , if added together, would easily exceed 100 years of electronics experience. If you ask a stupid question here, you better precede it with :
"This might be a stupid question, but here it is..." (I didn't see that in your post)

If you do that, we never criticize you. Secondly , you are expected to some kind of research on your topic before posting. We're aren't here to tell you the resistor color code. We would give you a link to do that. In the case of interfacing an audio signal, what happens if we Google:
"arduino interfacing audio signal "

2nd link down from the top of the list
Arduino-Audio-Input

Ok, so now to the questions:
1- Why can't you wire directly to the analog input ?
ANSWER; An audio signal is AC (not DC) and therefore contains both a positive transition and a negative transition. If you look at the arduino specs, the analog input can only support dc 0 to 5V signals. The schematic you posted is a correct audio interface because it contains the two requirements of an audio input,
A=voltage divider to bias the signal to the midpoint (2.5V) of the allowable range
B- A coupling capacitor to couple the AC to the divider.

This is not a high pass filter. This is a coupling capacitor and a bias voltage divider.

Next question:
"Why not connect the audio signal directly to the serial pin and have it print out the signal ?"
Ok, this question is more complicated , though on the face of it is cut and dried. A serial input is an input pin that understands ASCII so anything sent to this pin must be in the ASCII code. Secondly , the serial receive pin does only that. In order for something to be printed out , it must first be received (in ASCII), read, interpreted (parsed) and then processed. You can write a simple routine that reads the input and echo's it to the serial monitor.
Have a look at this tutorial:
An audio signal , connected directly to a serial Rx pin would violate the rule of "no negative voltages may be applied to any input pin.", plus the pin wouldn't understand AC because it's not ASCII.

I was using a multimeter to measure the signal voltage (I know, it averages). I figured it was just a standard audio signal, since it works fine with any headphones. Judging by that, the reading appeared to make sense.

Was the meter on AC ?

I suppose the voltage probably oscillates from positive to negative, and not 0 and up. The meter definitely wouldn't be able to pick that up.

Again, what range/mode was the meter in ? (AC or DC?)
No, the signal is not oscillating. Oscillation is something completely different. The signal has a positive transition and a negative transistion. That is simply called AC, not oscillation.

My assumption was that LINE LEVEL was just like a data signal, only analog. I understand what went wrong now.

"what went wrong " was that you made assumptions with absolutely no electronics experience. That's "what went wrong".

Did you Google LINE LEVEL ? (no, of course not, or you wouldn't have asked such a question)

How can a signal be "just like a data signal , only analog" ?
Do you know what the difference is between analog and digital ?
Any other questions ?

raschemmel:
Let's not exagerate. No one was rude. If you are offended by someone telling you that you are inexperienced when you post on the forum with a stupid question then you should post somewhere where they are afraid to tell you the truth. Our job here is to tell you the truth , the whole truth and nothing but the truth. The truth is you are inexperienced . You know that , I know that, and now the whole world knows that. Is that a problem ? (not for me , is it one for you ?) If you had researched your topic on Google we wouldn't be having this conversation. Next time Google your topic first.
Ok, let's talk about teaching techniques first and then get to the questions. If you are in a class in a college, with a well known respected professor, (let's say, for example, one who did consulting for NASA for the Apollo missions) , how would you expect him to respond to a stupid question ? Why is the forum any different ? Do you think that just because you CAN ask stupid questions that you SHOULD ?
What kind of mentors would we be if we let you get away with being stupid , huh ?
We are supposed to teach you how to teach yourself, not how to ask us.
If you post on the forum , you are posting in a place where the experience of the members who are going to answer your question , if added together, would easily exceed 100 years of electronics experience. If you ask a stupid question here, you better precede it with :
"This might be a stupid question, but here it is..." (I didn't see that in your post)

If you do that, we never criticize you. Secondly , you are expected to some kind of research on your topic before posting. We're aren't here to tell you the resistor color code. We would give you a link to do that. In the case of interfacing an audio signal, what happens if we Google:
"arduino interfacing audio signal "

2nd link down from the top of the list
Arduino-Audio-Input

Ok, so now to the questions:
1- Why can't you wire directly to the analog input ?
ANSWER; An audio signal is AC (not DC) and therefore contains both a positive transition and a negative transition. If you look at the arduino specs, the analog input can only support dc 0 to 5V signals. The schematic you posted is a correct audio interface because it contains the two requirements of an audio input,
A=voltage divider to bias the signal to the midpoint (2.5V) of the allowable range
B- A coupling capacitor to couple the AC to the divider.

This is not a high pass filter. This is a coupling capacitor and a bias voltage divider.

Next question:
"Why not connect the audio signal directly to the serial pin and have it print out the signal ?"
Ok, this question is more complicated , though on the face of it is cut and dried. A serial input is an input pin that understands ASCII so anything sent to this pin must be in the ASCII code. Secondly , the serial receive pin does only that. In order for something to be printed out , it must first be received (in ASCII), read, interpreted (parsed) and then processed. You can write a simple routine that reads the input and echo's it to the serial monitor.
Have a look at this tutorial:
An audio signal , connected directly to a serial Rx pin would violate the rule of "no negative voltages may be applied to any input pin.", plus the pin wouldn't understand AC because it's not ASCII.

Does that answer your questions ?

By the looks of your bio, you seem to be an Electronics Engineering Technician with 35 years of experience. With your type of "know it all" attitude, I am surprised. After all, I can't imagine a business owner or manager hiring and retaining someone with your impossible attitude no matter how knowledgeable he/she is (not for 35 years that is).

P.S. Coupling caps are used as a sort of HP filter. They pass AC signals while DC signals are attenuated to nearly -infinity dB. And since AC signals have some nonzero frequency while DC signal frequencies are 0, higher frequencies pass and DC (the lowest) frequencies are attenuated. This = HP filter (a special one, though).

This = HP filter (a special one, though).

If it were a HP filter it would not pass the low audio frequencies, which it obviously does.
I stand by what I said. It's a coupling cap, not a HP filter. You could argue that an RC HPF is a cap input with a resistor to GND, and the voltage divider contains such a resistor, ergo it's HPF.

By the looks of your bio, you seem to be an Electronics Engineering Technician with 35 years of experience. With your type of "know it all" attitude, I am surprised. After all, I can't imagine a business owner or manager hiring and retaining someone with your impossible attitude no matter how knowledgeable he/she is (not for 35 years that is).

I was hired because of my DeVry degree (BSEET). I told the hiring manager straight out that I had no experience in the particular position he was trying to fill. He simply replied "You have a degree from DeVry, you should be able to figure it out..."

The engineers I work with really have no idea what I know. All they know is that when they give me an assignment I "get it done" and it works (and looks) the way they want it to. They often have no idea how I am going to do something. They tell me " I need a {blank} that does [blank]. See what you can come up with and call me." They have never asked me what I know or don't know and I never ask stupid questions.
And just for your information, permitting students to continue to ask stupid questions (without first saying "this might be a stupid question") is not a good way to teach students. At DeVry, all the professors were working professors (a requirement at DeVry) meaning they had jobs working in their field. If we asked a stupid question in class they would make sure everyone knew it was stupid. Their message was clear "do your homework !" (before you ask a question)

raschemmel:
ergo it's HPF.

^ Wait... so you're agreeing with me?

Also, check it out:

I especially find this sentence intriguing:
"Coupling capacitors are used to block D.C. (D.C. = bad Ju-ju) , and pass A.C. (A.C. = the music signal). However, a coupling capacitor acts as a high pass filter, meaning it will attenuate frequencies below a certain point."

Let me translate: The -3dB frequency (or corner frequency) is very VERY close to 0 rad/sec, but isn't. It still attenuates low frequencies. Therefore, it is still a HP filter.

Also, check this out:
http://www.electronics-tutorials.ws/filter/filter_3.html

Under the High Pass Filter section you can find this statement:
"A very common application of this type of passive [HP] filter, is in audio amplifiers as a coupling capacitor."

You were right, though, about the level shifting from 0 to 2.5V

Let me translate: The -3dB frequency (or corner frequency) is very VERY close to 0 rad/sec, but isn't. It still attenuates low frequencies. Therefore, it is still a HP filter.

T = RC =100000*0.000001 F = 0.1 Seconds (100 mS)

fc =1/(2PiRC) = 1.59 Hz (that's pretty low)

Frequency Response Of RC circuits

Low gain != no gain

^ this is true no matter how hard you try to say otherwise. You might as well be saying 4+4=4.9 since 4.9 is so close to 5.

EVEN STILL, let's say the transfer function of the circuit caused the bode plot to be discontinuous at frequency = 0. As in the gain goes from some dB (lets say 0dB) at all nonzero frequencies down to -infinity dB instantaneously at frequency = 0. Although this behavior isn't possible in the real world, let's assume it is. Even still, if you look at the definition of a HPF, it still has the same properties as a HPF. Namely, it passes high frequencies and attenuates low ones. In this case, it cuts w=0 and passes higher frequencies. That is why I said it was a special HPF:

Power_Broker:
This = HP filter (a special one, though).

But, like I said, the above case is impossible in real life (welcome, by the way) and there is, in fact, a nonzero -3dB cuttoff frequency.

No matter how you dice it that circuit was not a low pass filter. Yes it has a certain frequency response but you failed to see what the circuit was for. So now you wriggle and claim you were right. You were not, get over it.

Grumpy_Mike:
No matter how you dice it that circuit was not a low pass filter.

Of course not. It has a high pass filter as part of the circuit. I never said there was a low pass filter anywhere.

Ok sorry typo, that is why comes of replying at nearly 4a.m.

Same comments apply, it is not the high pass filter you claimed it to be. You do not have two resistors in a high pass filter. Just because something has a frequency response doesn't make it a filter. Would you call an audio amplifier a band pass filter because that is the frequency response of one? Everything with a frequency profile is not a filter. No electronic circuit has an infinite response so I assume you would call every circuit a filter. It is not correct or helpful to do this.

Raschemmel, people like you are the reason why I loathe posting a question in the forum. When I get stuck on something and have nowhere to turn, this forum is my last resort. I spend hours trying to figure out how to answer my own questions. I don't just jump on here and ask whatever comes into my head. If I'm too inferior for you to respectfully assist, then don't bother answering my questions. I know I'm inexperienced, I know I'm asking something that others might see an obvious answer too. Leave out what I already know and just provide useful information or don't bother to help at all. Why do you palaver if it's such a waste of your vastly superior brain?

Thanks to everyone else who contributed something helpful. This thread is completely off topic so I'm going to delete it. I can't stand this forum anymore, I'm deleting my account. Weeks of misguided research is less frustrating than interacting with one impudent smart-ass.

Sorry for taking it off topic I thought it had ended. I was trying to tie up a loose end.

Grumpy_Mike:
Sorry for taking it off topic I thought it had ended. I was trying to tie up a loose end.

No harm done Mike, you've always been the most helpful person since my very first use of this forum.

@griffin175: raschemmel is considered by several people on this forum, including me, to be very rude and insulting. He either doesn't understand this or care.

How does this circuit work if the signal is diluted to almost nothing? Why not simply wire the audio signal directly to an analog pin?

The circuit uses a voltage divider to raise the average DC voltage at the analog input to 2.5V, which is required because only positive voltages can be measured by the ADC. The capacitor couples the line level audio, which is AC and typically 1 - 2 volts peak to peak maximum. The result is a signal varying above and below 2.5V, which the analog input digitizes for processing by the Micromodem software (if that is your intent).

The signal sent by the Micromodem software is audio, with 1/0 bits encoded as two-tone signals, 1200 and 2200 Hz if I remember correctly.

Why do you palaver if it's such a waste of your vastly superior brain?

I reply because I am here to help. My idea of helping is addressing the issue first and the question second. The "issue" is that you didn't research your topic first , as I pointed out with the Google search.
Also, you didn't tell us anything about your background. You didn't start your post with "I am new to electronics and I don't understand etc..." The fact that you were/are upset is not really an issue because that is simply ego and it will pass.
If you swallow your pride and just focus on the information , you will learn much faster. The issue is not that you don't understand that an FSK modem needs a combination of 1200 Hz and 2400 Hz audio tones as JRemington explained. The issue is that you never researched FSK modems or read the Micromodem tutorial to begin with. Had you researched FSK MODEMS or actually read that tutorial you linked you would have known that it only understands tones.
Frequency-shift_keying

Frequency-shift keying (FSK) is a frequency modulation scheme in which digital information is transmitted through discrete frequency changes of a carrier signal

The middle part is the input stage. This part AC-couples the input from the speaker jack of the radio and provides a 2.5v DC-bias, so we will be able to sample the audio with the ATmega's ADC. R10 and R11 constitutes a voltage divider that provides a 2.5v bias source from the ATmega's regulated 5V output.

The issue is that your idea of research doesn't work. You need to change your method of researching a topic. You're upset because I am telling you what no-one else will.
You don't learn by feeling good. You learn by realizing you didn't do something you should have, like research FSK modems before posting. Does that make me rude ir insulting ? I don't think so.
In answer to your question, I do it because I am here to help. And I am still here to help. This forum is not a social media site. It's about information. Just worry about that , and don't get all bent out of shape. That's totally unnecessary and counter productive. Just suck it up and move on.

I spend hours trying to figure out how to answer my own questions. I don't just jump on here and ask whatever comes into my head

Really ?
How is it you didn't Google "FSK MODEMS" or read the following from the tutorial you linked ?

What does this say ?

MicroModem Quickstart Guide
This guide provides a few pointers on getting started with MicroModem, how to build the circuit, what options to set in the software, and how to compile and flash the firmware. The USB-serial connection to the modem is 9600 baud, 8N1, no flow control.
Notes on the circuit
The circuit for MicroModem is really simple, and only needs a few common components. Even so, you might want to modify a few things depending on what medium you want to use MicroModem over. The default configuration of the circuit works well for sending the modulated waveform over hanheld ham-radio transceivers. This means a few things for the circuit:

  • Modulated output audio from the modem is brought down to microphone level voltages before leaving the modem. This is around 20mV peak-to-peak.

  • The PTT triggering part of the circuit is designed with the assumption of a Kenwood HT style PTT switch, namely: The ground pin on the microphone jack of the radio supplies about 3v, which will trigger PTT if it is connected to the ground pin of the speaker jack. The circuit accomplishes this by using a N-channel MOSFET to operate as a switch between the +3v and GND for PTT. Don't use a bipolar junction transistor for the PTT triggering: I have found them to be way to susceptible to picking up the RF radiation from the radio, and keeping the PTT triggered! You need a MOSFET.
    Have a look at the schematic here. The circuit is divided into three logical parts.

  • The topmost part is the PTT triggering circuit.

  • The middle part is the input stage. This part AC-couples the input from the speaker jack of the radio and provides a 2.5v DC-bias, so we will be able to sample the audio with the ATmega's ADC. R10 and R11 constitutes a voltage divider that provides a 2.5v bias source from the ATmega's regulated 5V output.

  • The bottom part is the output stage. This part is basically a very simple “soundcard”. R1 through R4 constitutes a 4-bit string-resistor DAC. C2 AC-couples the output, and R5 and R6 divides the output voltage down to around 20mV peak-to-peak. Most radios wont be able to accept the line-level output generated directly by the ATMega, without distorting it to a point where it will be impossible to correctly demodulate again. But, if you want to test the modem over a direct 3-wire connection from modem to modem, you MUST take the modulated output before the R5/R6 voltage divider. The ATmega ADC is not sensitive enough to demodulate audio in the 20mV range! (Well, maybe it is, if you supply a tightly regulated 20mV reference for the ADC, but that is beyond the scope of this document)

We're here 24/7.
Welcome to the forum. Now Google "FSK modems"

MicroModem Quickstart Guide.doc (113 KB)