Digital Sound to Analog Sound

Discussion in 'General Electronics Chat' started by abuhafss, Jan 31, 2015.

  1. abuhafss

    Thread Starter Active Member

    Aug 17, 2010
    153
    2
    Hi

    Is it possible to to convert digital sound for example police siren generated using 555, to a real analog sound? If yes, how?
     
  2. wmodavis

    Well-Known Member

    Oct 23, 2010
    737
    150
    Hook the output to a speaker.
     
    absf likes this.
  3. abuhafss

    Thread Starter Active Member

    Aug 17, 2010
    153
    2
    :D Perhaps, I didn't put my question clearly.

    Of course, it is understood that the sound (digital) coming out from the 555 siren circuit could be heard using speaker. But, the quality of that sound is not smooth.
     
  4. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    It's not smooth because it's a square-wave but that doesn't mean it's not a "real analog sound" when run through a speaker.
    You could run it through a high-order low-pass filter to remove the harmonics that generate the harsh sound, leaving only the fundamental sine wave.
     
    Sinus23, abuhafss and absf like this.
  5. wmodavis

    Well-Known Member

    Oct 23, 2010
    737
    150
    Clarity and precision are foundational especially when discussing technical subjects but that should not prevent them from being highly important of all communications.
     
  6. abuhafss

    Thread Starter Active Member

    Aug 17, 2010
    153
    2
    May I have some more details, please.
    That's totally a new stuff for me.
     
  7. Sinus23

    Member

    Sep 7, 2013
    161
    409
    This is from talking electronics.com. It produces more of a triangle wave than a sine wave. But at least it is smoother than a square wave.

    [​IMG]
     
    absf likes this.
  8. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    the RC combination on the output needs to match the frequency to get it more closer to a sinewave.
     
  9. Sinus23

    Member

    Sep 7, 2013
    161
    409
    True ;)
     
  10. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    Below is the simulation of a 1kHz squarewave into a 3-pole 1kHz low-pass active filter.
    The filter removes most of the squarewave high frequency components, leaving the fundamental sinewave with reasonably low distortion V(out).

    For comparison the output is also shown from a 1-pole passive 1kHz RC LP filter V(out2). As you can see it looks more like a rolled off squarewave rather than a sinewave.

    Note that the filter is basically for a single frequency and the output amplitude will be reduced as the squarewave frequency is increased.
    If the frequency is reduced the distortion will increase.

    If you don't mind some distortion in the output then you can use a simpler filter.

    Here is the website I used to generate the filter component values.

    Filter.GIF
     
    Last edited: Jan 31, 2015
    cmartinez, abuhafss and Sinus23 like this.
  11. abuhafss

    Thread Starter Active Member

    Aug 17, 2010
    153
    2
    Thanks for your input.

    Okay, now for example if there are two tones with different frequencies to be mixed; do they need two separate low-pass filters before mixing or only one after mixing?

    Please see this schematic. Did I understood the subject correctly?

    Screenshot 2015-02-01 16.06.23.png
     
    Last edited: Feb 1, 2015
  12. Nykolas

    Member

    Aug 27, 2013
    87
    31
    Here is a sine shaper:[​IMG]
     
  13. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
  14. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    Yes, you would need a separate filter for each frequency you generate with the filter corner frequency equal to the square-wave frequency.

    Edit: If you need a sinewave then generating the sinewave directly, as bertus suggested, might be a better choice.
     
    Last edited: Feb 1, 2015
  15. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,791
    945
  16. abuhafss

    Thread Starter Active Member

    Aug 17, 2010
    153
    2
    Okay, then which of the techniques mentioned in the link should I start with to have a harmonic-free final signal? And again, do I need to introduce two sine-wave generators for each frequency and then mix them?

    Please bear with me, as I already mentioned I am absolutely new to this subject.
     
  17. electrojim

    Member

    Jun 3, 2009
    11
    0
    A low-pass filter will certainly modify the harmonic content of a square waveform, but perhaps abuhafss wants to retain a bit of the siren sound, and sirens don't put out sine waves. I'd suggest hooking a 100k pot in series with the output, and a 0.01uF cap on the far side of that. Then he could play with the sound and determine if even more filtering might be desirable.
     
  18. abuhafss

    Thread Starter Active Member

    Aug 17, 2010
    153
    2
  19. abuhafss

    Thread Starter Active Member

    Aug 17, 2010
    153
    2
    Of course, I do.

    Do you mean the outputs of each 555 or the output labelled OUT-MIX?
     
  20. electrojim

    Member

    Jun 3, 2009
    11
    0
    I'd go before the OUT-MIX. That's already low-pass filtered by two separate filters. Forget those filters for now. From each of the 555 outputs, connect a 1k resistor to a common point. We'll call that the 'combining' point. Connect that common (combined) output to one end of a 100k pot, and from the wiper, put a 0.01uF cap to ground. Because the 555s give an output between the supply rail and ground, cap-couple from the top of the 0.01uF to your amplifier, or whatever you're feeding. That will remove the DC offset. Now start up your 555s and crank on the pot to see if you can get a sound you like. What this will do is remove the 'edge' from the sound (some of the way-out harmonics), and give you mostly the 3rd and 5th harmonics.

    Now if you want to get really fancy, stuff some current into the 555 so that the output is not a symmetrical square wave. Once you destroy the symmetry, you'll have even-order harmonics in there too. Most people feel that even-order harmonics (2nd, 4th, etc.) sound less strident than the odd-order ones. You'll have both, even and odd, in this case, but you might like the sound better.
     
Loading...