Maker Pro
Maker Pro

Microphone Input to Square Wave

Hello, all,

Sorry for the mixup in the title. I'm having an issue understanding the idea of taking an electret microphone output and turning it into a square wave to be used on a basys board. To my understanding, the output from the microphone is sinusoidal, and I'm filtering it with a band-pass filter and making it square with Schmitt Trigger. From there, it goes to the board and the rest isn't an issue. My issue is do I treat the mic output as AC because it is Sinusoidal, do i treat it as DC, or what? I've searched around for an answer, but have been unsuccessful.
 

Harald Kapp

Moderator
Moderator
For whatever reason you want to treat the mic's signal as a square wave...

My issue is do I treat the mic output as AC because it is Sinusoidal, do i treat it as DC, or what?
AC is for Alternating Current and does not imply a specific waveform (like sinusoidal). Any waveform (apart from DC 0V) with a mean value of 0V is AC, although sinusoidal signals make for a large number of AC signals. A square wave with alternatingly positive and negative pulses of the same duration is AC, too.

A microphone's output can be AC or a mixture of DC and AC, depending on the mic's technology. An electret microphone for example delivers a DC signal with a superimposed AC signal. A capacitor is used to separate the AC from the DC, see the image in the Wikipedia article.

Short answer: trat the mic's output as AC.
 
Your circuit plan sounds ok. Does your bandpass filter have any voltage gain? If not, the signal level into the comparator will be very low, increasing the likelihood of edge position noise in the output squarewave. What are you trying to achieve with this circuit? Frequency analysis? Presence/absence detection?

ak
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
just to be picky and in Ratch's words ... hopelessly pedantic ;)

Don't forget, you can have an AC waveform that never goes through 0V

one that is DC offset
But by definition can that really be termed AC? After all the current only varies in level but doesn't change polarity. Wouldn't "Pulsating DC" be more accurate? Yes... PICKY! :D

Chris
 

davenn

Moderator
But by definition can that really be termed AC?

of course it can, your oscilloscope would see an AC waveform :)

consider the AC ripple on the output of a rectifier and smoothing cap ... we don't call it DC ripple, aye

After all the current only varies in level but doesn't change polarity.

1/2 the waveform is more negative ( or more positive) than the other ... sounds pretty definitive to me ;)

the 0V line is just an arbitrary reference point, it can be set anywhere. the AC waveform is cycling plus and minus that reference point (level)


Wouldn't "Pulsating DC" be more accurate? Yes... PICKY! :D

Its not pulsating if it is sinusoidal ... that' not a pulsing definition

a square wave would be more like a pulsing signal but even that can be deemed AC


Dave
 
I think the point is that if a sine or square wave is wandering around between +7 V and +8 V wrt GND, then electron flow does not reverse at any time wrt to any other time. So is that truly "alternating" current? Or is it more correctly called the AC component of the overall signal? I've seen power supply ripple called th AC component of the output. Can (should) that term be applied to non-power supply circuits?

ak
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
40 years ago, at a lab I worked in, we called generic Y axis scope traces "perturbations". I'd rather use this term over the misnomer AC for instances like this. ;)

Chris
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
Who would have thought that we'd be debating over a term so basic as AC? I never thought its definition was ambiguous.

Chris
 
I know, and I like it. It is good to review from time to time things that "everybody knows". In this case, it comes down to what is meant by the word "alternating". Varying amplitude of the EM field(s)? Varying direction of electron movement? I think the fact that the term is alternating current and not varying current is significant. The term goes back to the dawn of power generation and distribution, when there wasn't much to play with. DC generators put out what we would now call pulsed DC, maybe with an inductor in series but unfiltered (in today's terms) because power rectifiers were decades in the future. AC generators were pretty much what they are today. The fundamental difference between the two was not amplitude variability, but electron direction, and the brains at the time knew that. So I think the original intent of the term is completely clear. But that doesn't preclude any evolution as technology has advanced.

For example, when I was but a wee lad in power engineering class, "power factor" had only one meaning: cosine of the phase angle between voltage and current, measured at zero-crossings because the waves might not be perfectly sinusoidal and zero-crossings were the only reliable standard points for measurements. Part of the definition was that there is no such thing as power factor for discontinuous waveforms because there is no predictable place to base the measurements. Power distribution grids had PFC caps on them, manufacturing plants with large electric motors paid more, and everyone was happy. And, the power factor of a capacitor-input power supply was meaningless. A few years later 1 billion switching power supplies happened, people started paying attention to power line harmonic distortion, and all of a sudden PF now included bizarre-shaped input current waveforms, with the measurement based on the peak current rather than the zero-crossing. I didn't get the memo.

So now that in both the power and signal arenas there can be a DC signal with an AC component and an AC signal with a DC component, what does the A in AC mean *today*?

ak
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
AcVsModulatedDc.JPG After much thought and consternation I present the attached simulation for perusal. As clearly indicated in the plots there is no AC present anywhere with the exception of VG1. I intentionally designed this with no caps or inductors that could muddle up this discussion.

So from this day forward I'm calling superimposed AC on a DC carrier "Modulated DC"! :)

ChrisView attachment 21885
 
Last edited:
Top