R/E/P Community

Please login or register.

Login with username, password and session length
Advanced search  

Pages: 1 [2] 3 4 5   Go Down

Author Topic: micro-timing in low sample rates  (Read 10508 times)

Yannick Willox

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 264
Re: micro-timing in low sample rates
« Reply #15 on: October 03, 2005, 07:02:12 AM »

Yes exactly, but some people still do not fully understand that time exists - between - two consecutive samples.

There is no time vacuum. Events are not shifted in time by the sampling process. Only events that are outside of samplingrate/2 are removed.
Events that exist within this frequency range are fully and time accurate reconstructed.

I wish the question wouldn't be misinterpreted so much, the answer in the other thread never came (I guess, I gave up reading all the pages with answers to a different question) ...
Logged
Yannick Willox
Acoustic Recording Service

maxdimario

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3811
Re: micro-timing in low sample rates
« Reply #16 on: October 03, 2005, 07:19:41 AM »

Quote:

will the peaks of the sine be SHIFTED to the sampling intervals ?


no that's not what I need to know, the sine is reconstructed in phase because of the filters.

Quote:

To me what you are describing is 1K or 5K sine wave AM modulated by perfect square wave with a period of 500ms. If you AM modulate a since wave, then you get sidebands around that 5K carrier. These sidebands depend on the frequency content of the modulating signal, the square wave. This perfect square wave has an infinite frequency content.

Very short times, such as this square wave require very high frequencies.


not really what I was trying to get at, I even tried to get away from this harmonic content/sideband thing by getting the sine to begin from rest at a low frequency. You get a thump as a result of the transition from rest etc., but I am concerned only with when the whole event begins

frequency is a function of time, of course, but I didn't say frequency was what I was concerned with, I wrote that I am concerned with the exact point the sine burst begins.
this could be a sine wave burst of 1 Khz, 2, 400 Hz, 60 Hz, it doesn't matter.

I chose a relatively high frequency to put it into easy perspective, but it need not be high, it could be 30 Hz.



...are you saying that since the filter at the input is always active it will translate the sound in time regardless of whether the converter is sampling or not?
Logged

Loco

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 508
Re: micro-timing in low sample rates
« Reply #17 on: October 03, 2005, 04:14:33 PM »

maxdimario wrote on Mon, 03 October 2005 07:19

not really what I was trying to get at


You sound like my wife... What do you want us to say?
Logged
Carlos "El Loco" Bedoya

"There's no right, there's no wrong. There's only popular opinion"   Jeffrey Goines
http://www.tukanart.com

Graham Jordan

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 63
Re: micro-timing in low sample rates
« Reply #18 on: October 03, 2005, 04:47:49 PM »

Phew! With all the back-and-forth, this seems to be a really trick one to put to rest.

My simple answer to the question: No.

I'm pretty sure I know what Max is getting at here.

So we have our 'ideal' (infinite bandwidth) burst geneerator that turns 'on' at some very definite time. By 'looking' at this signal with infinite bandwidth you can 'see' where it turns on. Say the turn on is a step up to the peak of the sine. Pick whatever voltage level, the time it passes this is the 'turn on' time.

Now make this more of a 'real' signal by limiting the bandwith, by passing through an ideal brickwall filter. You'll find that there is some signal ('looks' like higher freqs) starting BEFORE the original start time. Also, the 'sharp' step is gone and there's a slope with a 'steepness' similar to the highest passebl freq at a large (larger than the burst) amplitude. So what's the start time now? I know people are going to get their heads mess up by this, but an ideal (zero delay all all freqs, brickwall) filter can produce an output signal before a step in the input (non-causal). This happens most for freqs before the cut-off freq. This is overcome in real filters as time delay  (changing phase delay in real analog filters, imposed time delay in digital 'flat phase' filters). My main point here is that, define the 'start' as you will (e.g. passing a certain voltage level).

Now you could substitiute a real world analog filter in place of the ideal one above. Now again you must define where the sine 'starts'.

Now turn the ideal generator on and off (0.01s bursts, 10s burts I don't care) at the SAME point in the 5kHz cycle, and pass it through the filter. You'll get the same 'start' waveform in each case, so however you define the start time, it will always be in the right place.

Now, turn the generator on and off at 'random' points in the cycle. After going through the filter, a simple voltage level 'start' criteria will show you some slight shifts in the start time, as the 'start' waveform will be slightly different. Slightly different obviously doesn't give you *exactly* the same. How closely to the original start time you get depends on the bandwith of the filter. See how time and frequency really are the same thing as far as these things go? Time resolution is bandwidth. To nail an event in time exactly (i.e. infinitely accurate timing) you need infinite bandwidth. BUT remember, this is using your arbitary definition of start as crossing a voltage level. The actual 'start' as far the signal goes is still really the same - it's the definition of 'start' that's bad.

Notice that I have so far NEVER mentioned the digital domain or sampling. You ability to nail a 'start' in time is limited by the bandwidth. When going through digital, you have a very well defined bandwidth limit (given by the sampling rate). However, what you put in, after the anti-alias filter, is what you get out - exactly! So the digitizing process does not affect the time resolution of the 'start' whatsoever - whatever you definition (hence my basic answer of 'no').

Let's take a littel example: Take the ideal generator, pass through the anti-alias filter. Measure the 'start' time (or time between bursts if you like - get's rid of delays) here in the analog domain, using whatever measure you like. Now pass the signal through the A/D then D/A and reconstruction filter and measure the 'start' time (or burst interval) for this. You will get the exact same answer, to a resolution less than the sample period! To be clear, the burst interval, or start time, is NOT rounded to the nearest sample period, or affected by the exact timing of the sampling.

Now to go the final step beyond the original question, and go into real audio, as audio gear is bandwidth limited, you can only ever define the 'start' of a signal to within a limit set by the bandwidth.

Of couse another answer is that signals never start or end Smile
Logged

Graham Jordan

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 63
Re: micro-timing in low sample rates
« Reply #19 on: October 03, 2005, 05:01:42 PM »

maxdimario wrote on Mon, 03 October 2005 04:19


...are you saying that since the filter at the input is always active it will translate the sound in time regardless of whether the converter is sampling or not?


Almost... the filter messes with your nice clean cut 'start time'. For a real filter it will delay the start by a certain amount. But this will always be the same amount (relative to the ideal start source). Defining the start in order to measure the result is not simple. Converting to digital has nothing to do with it and will not further change it.

Ignoring simple time delay, a filter changes the signal in the frequency domain, so also changes it in the time domain. That's where you're getting hung up: the frequency modification of the step by the filter changes how it looks in the time domain.
Logged

Phillip Graham

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 280
Re: micro-timing in low sample rates
« Reply #20 on: October 03, 2005, 06:17:10 PM »

Graham Jordan wrote on Mon, 03 October 2005 16:47



Now make this more of a 'real' signal by limiting the bandwith, by passing through an ideal brickwall filter. You'll find that there is some signal ('looks' like higher freqs) starting BEFORE the original start time. Also, the 'sharp' step is gone and there's a slope with a 'steepness' similar to the highest passebl freq at a large (larger than the burst) amplitude. So what's the start time now? I know people are going to get their heads mess up by this, but an ideal (zero delay all all freqs, brickwall) filter can produce an output signal before a step in the input (non-causal). This happens most for freqs before the cut-off freq. This is overcome in real filters as time delay  (changing phase delay in real analog filters, imposed time delay in digital 'flat phase' filters). My main point here is that, define the 'start' as you will (e.g. passing a certain voltage level).



Hey Graham,

Great reply, getting messier than I wanted to.  You might be interested that the apparant "non-causal" filter pre-ringing that you see in electronics also shows up in physics, in anomalous refraction experiments (index refraction is negative).

The phase velocity of some components of the wave packets in the experiment are supraluminal, but the group velocity is still subluminal.

The physicists and information theorists have lots of views on this behavior, questions of what the speed of light really is, what exactly constitutes conveying information, etc.  Interesting stuff.
Logged
Phillip Graham

Gunnar Hellquist

  • Full Member
  • ***
  • Offline Offline
  • Posts: 206
Re: micro-timing in low sample rates
« Reply #21 on: October 04, 2005, 02:01:53 AM »

Max,
    I think the problem is that you visualize something that is non-existant in the real world. The sort of vision I believe you have is what it would look on an oscilloscope. It starts with a perfectly straight line, that suddendly changes into a burst of sine waves.

One of the problems with this picture is that this sudden change from straight line to sine wave is a rather sudden change. Look at it very closely and you will see that the slope of the line starts from 0, the straight line, to very high, almost straight up in no time at all. Without going into math this is a sign that there is a lot of high frequency content in that signal. This sudden change in slope is what gives it away.

If you run this info throgh an AD and then a DA, the output wave form will not look the same as what you put in. It will instead start with a few short ripples and a gradual change into the sine signal. There are ways to treat this mathematically to extract information from the output signal, but it depends on what else you know about the signal.

One way of visualizing this is to say that the very start of the burst is sort of out of focus. You cannot really see exactly when it started.

In fact most of the effect is not from AD or DA but from the analog filters before the AD. If you simple apply the signal directly to the AD that AD will sound very bad in real world audio applications. All audio AD-s known to man has a filter before the AD conversion takes place.

If you know that your burst always started at a zero crossing of the sine signal, you could actually time the start of the signal very closely, much better than the sampling interval. If instead your signal burst starts anywhere on the sine signal, with a sudden jump, I know of no way to extract timing information to a better resolution. In fact my guess is that the resolution will be half sampling interval, but I have not really done the math.

So for one single burst the math will show you an error band within which the burst may have started. This error band will most probably be at least a few sample intervals. If you get recurring bursts you may treat these starting times and get a smaller error bands the more burst you can measure. With enough burst, and assuming that other errors are smaller, you may get down to subsample timing.

If what you want to do is to time things very accurately through an AD/DA connection, you could design a burst signal that allows you to get even better timing information. The suddenly starting sine signal is not the best burst in that case. A few topics away there is a discussion of "better then Nyquist" with an article that shows some ideas on how to start designing such a burst signal. It takes a bit of math to handle these things correctly, and I must admit that I never really got into the area, and what I did know is now lost in old dusty books not opened in many years.

Now, the interesting question humming in my mind is what your question really is. I mean why do you want to know this? Is it for a specific application? Is it a work to try understanding sampling theory without doing the math? In any way, the exact question you are asking is from an audio point of view not that interesting. The ear cannot resolve timing down at this level and according to most it does not hear anything above 20k or so. In other context, such as measuring various things knowing how to handle the math here may make an otherwise impossible measurement possible.

In humble respect of people who really knows this subject, I hope this may help in understanding the answer.
Logged
Gunnar Hellquist
unafiliated

C-J

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 80
Re: micro-timing in low sample rates
« Reply #22 on: October 04, 2005, 09:52:21 AM »

maxdimario wrote on Mon, 03 October 2005 14:19

I wrote that I am concerned with the exact point the sine burst begins.

Max,
You have got many excellent answers here. If I understand your concern correctly, you're worried about if the sample timing somehow will affect the start time of your bursts? If so, maybe this very simple graph may help?

It shows the reconstructed waveforms of two, one cycle snippets of a 4410Hz sine waves.(Such bursts don't excist in the real world, these should be looked at as graphic snippets from longer waveforms, only).

index.php/fa/1653/0/

The second one "has happened" to start 0.5/44100 sec later (or earlier), i.e. half a sample. The reconstructed waveforms look (and sound) EXACTLY the same, although they "happen" to be sampled at different times of their cycles. This just shows that the timing of the sample points does not affect the waveforms during the AD/DA process(es).

C.J., Finland
Logged

Graham Jordan

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 63
Re: micro-timing in low sample rates
« Reply #23 on: October 04, 2005, 01:05:38 PM »

OK, here's something that we all may find useful. This was done using Cool Edit. The thing about coold edit is that it shows you the signal BETWEEN samples - i.e. for display, it upsamples the data and does the reconstruction filtering (not sure about the details of the reconstruciton filter), putting the actual sample points in bold.

index.php/fa/1655/0/

So what is this? This is a 'zoomed in' image of just the start of an 'instant on' 5kHz sine with 96kHz sample rate. Note that this generated in the digital domain, not the analog domain. It was done by generating a 5kHz tone, then chopping the front half of the wave off. Note that this is NOT the entire waveform I generated. There is about 1 second of silence before the 'turn on' and 0.1s of tone after. (this is an important point, especially the continuing sine after the snd of this view)

Note the pre-ringing, and ringing after the 'turn-on'. Note how the actual signal peaks higher than any of the sample values, and even the steady-state sine peak. So what's the start time here??

Note also that the ringing is 60dB below the signal level 12 samples before the 'start', 90dB below at 18 sample before. (you can't make this out from the graphic - I had to examine the data) - even though every one of those 12 or 18 samples is exactly zero! This is where the reconstruction filter knows exactly what to do, but is it not intuitive.

As a step beyond this topic, you can 'turn-on' the sine in a special way to reduce this ringing. It uses a 'window' function at the 'turn-on' and 'turn-off' points. Basically you can think of it as a very specialized mathematical 'fade-in' and 'fade-out'. In this case it may only need to operate over a few 10s of samples. The point is that then there is no clearly defined 'turn-on' time - as the signal 'turns-on' over several samples.

Hope this helps.
Logged

Graham Jordan

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 63
Re: micro-timing in low sample rates
« Reply #24 on: October 04, 2005, 01:27:11 PM »

OK, here's another graphic, this time closer to the original question.

index.php/fa/1656/0/

This time, I generated a digital 'instant-on' 5kHz sine at 96kHz sample rate, that starts with a zero sample (i.e. zero crossing, with sample at crossing). The problem with this is that the start point is aligned with a sample point. So I then did a high quality downsample to 44.1kHz. This is pretty close to converting to analog then converting to digital again, and should be a pretty good representation of the 'ideal' real world example. I went to 44100 and not 48000 so that the start time would not again hot a sample point.

This time you still see the ringing, although it's slightly less obvious (in the 'filled-in' analog version). Note that this time, the 'lead-up' samples are not all zeros since this was effectively sampling an analog like signal (rather than a purely digitally generated one). I think you can still see quite clearly about where the sine wave 'starts' - although this time it's in between samples.

(Note that the yellow dotted marker does NOT indicate the 'start', it this pic it's arbitary - but always midway between sample points)

Graham
Logged

C-J

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 80
Re: micro-timing in low sample rates
« Reply #25 on: October 04, 2005, 02:39:15 PM »

Graham Jordan wrote on Tue, 04 October 2005 20:05

OK, here's something that we all may find useful. This was done using Cool Edit. The thing about coold edit is that it shows you the signal BETWEEN samples - i.e. for display, it upsamples the data and does the reconstruction filtering (not sure about the details of the reconstruciton filter), putting the actual sample points in bold.

Graham,

Interesting pics! The reconstructed "BETWEEN samples" display, is a really 'cool' feature in Cool Edit Pro, and it's successor Adobe Audition, in which I created my screenshot.

I also made a similar test as yours, and found that you have used the "Silence" command when you "chopped the front half" out of your first pic. If you use "Cut" or "Delete", the new start of the wave will get a "Fade In" level envelope curve, like this:

index.php/fa/1660/0/

It seems to be because AA makes a "Cut/Delete & Smoothing" of it, according to the Undo history, when you cut or delete.

My best,
C.J., Finland
Logged

Graham Jordan

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 63
Re: micro-timing in low sample rates
« Reply #26 on: October 04, 2005, 03:04:58 PM »

C-J, I actually generated a short tone as a totally new file (no fade in etc.), then created a longer new file of silence, then cut and passted the tone into the silence (no smoothing). I could also cut and paste an arbitary section of the oringinal tone to get different 'start' points.
Logged

Gunnar Hellquist

  • Full Member
  • ***
  • Offline Offline
  • Posts: 206
Re: micro-timing in low sample rates
« Reply #27 on: October 04, 2005, 04:17:48 PM »

Graham, have to say I love your pictures.

Logged
Gunnar Hellquist
unafiliated

maxdimario

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3811
Re: micro-timing in low sample rates
« Reply #28 on: October 04, 2005, 05:14:45 PM »

Yeah, like I said above, I am thinking of pure test tones with an ascilloscope and technical issues in mind, not sound.

are you saying the pre-ringing can accurately define the wave beginning point even though it's between samples?

isn't there an element of error which is related to the sampling freq.? would there be any error at all in real-world applications?

great graphs, by the way.
Logged

Jon Hodgson

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1854
Re: micro-timing in low sample rates
« Reply #29 on: October 04, 2005, 05:34:58 PM »

maxdimario wrote on Tue, 04 October 2005 22:14

Yeah, like I said above, I am thinking of pure test tones with an ascilloscope and technical issues in mind, not sound.

are you saying the pre-ringing can accurately define the wave beginning point even though it's between samples?

isn't there an element of error which is related to the sampling freq.? would there be any error at all in real-world applications?

great graphs, by the way.


Hi Max,

I'm in the middle of something now, so no time to generate pictures and upload them, but I can tell you that earlier I was happily moving signals by quarter sample increments using cooledit.
Logged
Pages: 1 [2] 3 4 5   Go Up
 

Site Hosted By Ashdown Technologies, Inc.

Page created in 0.106 seconds with 20 queries.