Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Trying to make a ~30 microsecond delay circuit

  1. Jul 26, 2012 #1
    Hi guys, I'm looking for advice on how to go about building a circuit that will delay a signal by about 30 microseconds. The delay needs to be adjustable, say between 10-50 microseconds. The signal is audio frequency.

    Basically I'm trying to make a noise cancelling device, i.e. a microphone picks up incoming noise, then inverts the signal, amplifies it, and puts it out a nearby speaker. I need the delay circuit because there is about 1cm of distance between the speaker and mic, so the signal has to wait for the sound wave to reach the speaker before cancelling it.

    I got the impression that this would best be done using digital memory. Is this true, and if so, what does that involve?

    Thanks for your help guys!
  2. jcsd
  3. Jul 26, 2012 #2
    I don't have much experience with audio delay. But I know this is very common in musical instrument circuit. Here is some links you can start:




    Look at some of the schematic and see whether that will help you. Sorry can't help you more.

    Just to talk out loud, how about ADC to FIFO. You clock in at freq depend on your frequency response requirement. Then all you need to is to program a delay clock. The simplest way may be using programmable counter to delay the start of the read out clock. Now you are dealing with delaying only the clock signal.
    Last edited: Jul 26, 2012
  4. Jul 27, 2012 #3
    I've been doing some more research, and I now think that a bucket brigade delay might be better (and less complicated to implement). I hear though that bucket brigades tend to pick up noise - will this be a problem in my case?
  5. Jul 27, 2012 #4
    Well, I think I have finally discovered the solution in the form of an all-pass filter. I will work out and post the actual circuit parameters for the edification of anyone reading this thread...
  6. Jul 28, 2012 #5


    User Avatar
    Science Advisor

    Be aware that an all-pass filter will delay different frequencies by different amounts. If however the delay is small enough (as I think is your case) then the all-pass filter can provide approximately linear phase shift (time delay) over most of the audio band.

    The all-pass filter [itex](1-\tau s)/(1+ \tau s)[/itex] has a phase of [itex]-2 \tan^{-1}(\omega \tau)[/itex], and gives approximately linear phase of [itex]-2 \omega \tau[/itex], which corresponds to an approx time delay of [itex]2 \tau[/itex] seconds, with a bandwidth extending up to about [itex]\frac{1.2}{\tau}[/itex].

    For a 30 microsecond delay for example you'd choose the time constant [itex]\tau[/itex] at about 15 microseconds and get reasonably linear phase up to about 12 kHz. The best way to get longer delays without compromising bandwidth is to cascade several filters.
  7. Jul 28, 2012 #6
    I am not familiar with delaying long delay like this. But I did work on noise cancellation. Not only you have to provide the inverted signal, the amplitude and phase of the frequency components of the signal is very important. I have to work on phase and amplitude compensation of different frequencies to optimize cancellation.

    I am not saying all pass filter is not going to work, but my guess is it's not going to be as simple. Again, I am just talking out loud from my experience that is not related to your application. I apologist if you find that I don't know what I am talking about.

    Do some simple experiment to see how well it works. Digital approach might be a long cut way, but for sure you can capture the amplitude and phase accurately.
  8. Jul 28, 2012 #7

    jim hardy

    User Avatar
    Science Advisor
    Gold Member

    Is this for human ears ?

    1 cm is a half wavelength at something like 15khz
    at that frequency mother nature would provide your phase inversion for you
    and at lower frequencies an electronic inversion would be pretty close...

    i wonder whether your delay is really necessary in the audio spectrum.

    http://gilmore2.chem.northwestern.edu/projects/noise_prj.htm [Broken]
    Last edited by a moderator: May 6, 2017
  9. Jul 28, 2012 #8


    User Avatar
    Science Advisor

    Just out of curiosity, here's a simulation of the all pass TF (1-s)/(1+s) for a randomly constructed band limited input (0.1 to 1.2 radians/sec). The ideal delay that I calculated above would be 2 seconds for this filter and the measured delay in the graph seems about 1.8 seconds. So agreement with theory doesn't seem too bad.

    This is ridiculously long delay of course, and a correspondingly ridiculously small bandwidth (0.2 Hz), but these will scale accordingly.

    Attached Files:

  10. Jul 29, 2012 #9
    I remember test drove an Acura RL a few years back, they were one of the first to have active noise cancellation. They did a good job in cancelling out the lower frequencies, but the higher frequency hissing noise from the wind is still very obvious. It really depends on where you sit, whether you get the high frequency in opposite phase.
    Last edited by a moderator: May 6, 2017
  11. Jul 30, 2012 #10
    This is intended for human ears - in fact it is intended to cancel out the human voice, so it will operate mostly in the 100-15000 Hz region. I am canceling a point source, so I am trying to kill the whole frequency range, not just low frequencies as in noise canceling headphones.

    @yungman - I am certainly new to this, and indeed to circuit design in general. I will probably be using 2x 15us delays, since that minimizes distortion. I'm planning to prototype my circuit after this first design phase, so we'll see if it works or not. I must admit that I'm a bit scared of trying to get into digital memory methods, given my lack of background.

    Thanks for the advice guys, it's really proving quite helpful.
  12. Jul 30, 2012 #11

    jim hardy

    User Avatar
    Science Advisor
    Gold Member

    phone company found they only needed ~2500 hz and most of that for high wispy female voices

    AM radio goes only to 5khz

    so now think back to standing waves
    they repeat every wavelength
    so there's a practical limit to how short a wave you can cancel most everywhere in a given size space

    what's sound - 1100 ft/sec?
    what is dimension of your space?
    How many wavelengths at 15khz fit in your space?
    How many quiet nodes will that make?

    sorry - not tying to talk down to you, instead trying to overcome my ineloquence at phrasing the right [STRIKE]question[/STRIKE] ??? [STRIKE]words[/STRIKE]?.
    i have this thought that just won't come out in clear unambiguous words. It's a picture of a standing wave in a room with a fog representing the sound, transparent where acoustic pressure rarified and opaque where compressed.

    old jim
    Last edited: Jul 30, 2012
  13. Jul 30, 2012 #12
    I don't think you can kill off the whole range of frequency. You need to provide the equal and opposite signal to neutralize the voice. Meaning you have to delay the voice and add back to the original signal to cancel out.

    Matching amplitude and phase is not as easy either. Either way will need knowledge. In fact, I feel doing it in digital could be easier. There is a lot of noise cancellation circuit around so you can study which one is better. Bucket Brigade is one.

    Actually for your frequency response, you need only an ADC to clock at 100KHz so you get 10uS per data. You can get away with just like 5 latch to serve as shift registers to get 50uS delay. Then you program to read out at a specific delay and what register to read from. All the control and shift register can be done in one FPGA. If you run at 200KHz, you get even better result.

    If you don't need precision cancellation, if you can find an ADC that present the data of the sample after a few uS without a clock delay, you can actually clock at 10KHz, then you'll have the data for 100uS. You can clock the data into the DAC anytime within that 100uS. then you don't even need any shift register. You just need simple logic and a 555 to create an adjustable delay between 10 to 50uS!!!

    Just talking out loud.
    Last edited: Jul 30, 2012
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook