|
Audio Asylum Thread Printer Get a view of an entire thread on one page |
For Sale Ads |
In Reply to: Re: But is recording technique getting better? posted by jneutron on August 22, 2003 at 13:49:58:
HowdyNope, if you for a moment assume that there is no level quantization, an appropriately bandlimited transient can show up in any phase and be correctly reconstructed. E.g. the sampled point isn't necessarily the peak, the correct peak will be there after the reconstruction filter.
Follow Ups:
I wasn't talking peak level.What I was getting at, is that an analog transient that crosses zero (arbitrary point of course) at any instant can show up in the sampled datastream up to 22 usec later. In fact, any analog transient superimposed on a slower signal can have the temporal relation shifted between the two waveforms by a max of 22 uS..
HowdyFine: it's also true that with the same assumptions a zero crossing can have any phase after the appropriate reconstruction filter. The phase isn't quantized by the sampling rate. The sampling rate affect the highest representable frequency.
Think about it, with no quantization of level, any appropriately bandlimited signal can be reproduced accurately. Putting it more simply, any sine wave with a freq less than the Nyquist rate can be easily represented and reconstructed and only if it's freq is rationally related to the sampling rate will there not be all possible phases of zero crossings present.
The real fun starts when you start quantizing the levels and/or you try to time limit the signal.
Ted:When you say
an appropriately bandlimited transient can show up in any phase and be correctly reconstructed. E.g. the sampled point isn't necessarily the peak, the correct peak will be there after the reconstruction filter
You're right, but doesn't "appropriately band limited" mean containing no signals with a component at more than half the sample rate?
So a 44.1kHz stream can't contain any anything above 22.05kHz, i.e nothing with a period of less than 45uS.
If there is information in the original signal that the ear/brain can discriminate down to the 20uS range, does bandlimiting (and therefore the subsequent A/D/A) have the effect of eliminating/smoothing/smearing that information?
HowdyMy whole point is that the sample rate isn't in and of it's self responsible for quantizing phase. As I point out in my response to John, with no quantization of level, all phases are possible. When you quantize the level things are more interesting and the sample does come into the picture, but it's been many years since I took DSP courses and my books are packed so I won't even try to come up with the relationship of quantization of level to resultant phase effects.
Perhaps Werner or some one else who does this stuff actively for a living will chime in.
you're right that anything up to half the sample frequency will be perfectly reconstructed (assuming no jitter, of course....)Now how does that jive with the fact that we can apparently hear arrival time differences down to around 20uS, or half a sample period? Doesn't sound like a CD has that level of time resolution.
I know I'm mixing up a bunch of concepts here, which is why I'm having trouble connecting the dots....
Peter
HowdySince you can represent any given sine with an arbitrary phase, you just add enough up to give you the attack or transient you want with what ever phase you want. (Limited by Nyquist for highest freq and ultimately the level quantization introducing enough errors which smear the time resolution.)
CDs can represent left and right channel phase differences which are quite small, smaller than a sample period. This is probably how great CD players with low jitter get a precise soundstage, even for higher freq instruments like the triangle, etc. (I'm just hand waving here.)
I don't know the exact time resolution of Redbook, but the simplistic argument that it's one sample period is clearly hooey.
""If there is information in the original signal that the ear/brain can discriminate down to the 20uS range, does bandlimiting (and therefore the subsequent A/D/A) have the effect of eliminating/smoothing/smearing that information?""peterMy take? absolutely.
In fact, take a look at a 44Khz sample rate of a 15 Khz sine wave..The reconstructed waveform looks like three 1 Khz sines superimposed in three phase..so the peaks are riding three crests..
The only way to get back to the real wave is to reconstruct with a wide window, whereas cd replay is point to point..Blowin Nyquist theory out the window..
Cheers, John
HowdyNope, if you use a proper reconstruction filter a 15k sine will be precisely a 15k sine after reconstruction.
CD is not point to point.
Look at the waveform..You will see what happens..I wish I could post a pic here.
HowdyI have. I used to write software for digital audio workstations.
Be careful what hardware and software you're using. Many software programs display samples connected by lines not what the waveform will look like when run thru the reconstruction filter.
that was fast..Yes, by looking at the dac immediately before any filtering, you see the step waveform. And the peak values at that point are visibly riding three sines. But, post filtering cannot reconstruct the peak value of the 15Khz signal on a cycle by cycle basis unless the filter is resonating at 15Khz.
Nyquist theory assumes the ability to reconstruct using more than one sample, much as an FFT requires many points.
It would be nice to have someone chime in who can support the math to show how point by point reconstruction is not really pure nyquist theory. I can't.
How do I get pics here?
HowdyHere, for example is a 14kHz tone (actually to keep your #'s correct I used a 14031.81818181Hz tone at 44.1kHz) displayed by a real program Cool Edit Pro.
HowdyPoint by point reconstruction introduces higher freqs than the Nyquist rate.
Anyway, we are off track. The whole point is that a proper filter allows finer time resolution than a naive 1/sample rate argument would indicate. An improper filter is more sloppy on the time resolution.
HowdyAs I said we are assuming band limited signals. If you are talking about only one cycle of a wave form that is decidedly not bandlimited.
Nyquist shows that as long as you have incrementally more than 2 samples per cycle of your wave you are OK unless you are extremely unlucky, e.g. you have a signal whose freq is exactly a rational relationship with the sample rate. Since the rational #'s are sparse in the real #'s this is rare :)
And if you are bandlimited you have many cycles of your signal so you see the correct peaks, etc.
If you have a picture host you just put the URL for your picture in the 'Optional Image URL' when you post. You can also put in the HTML IMG tag, if you want it somewhere other than at the top of your post. If you don't have an image host, the Asylum provides inmate picture galleries for contributors.
Thanks for the pic info Ted..""And if you are bandlimited you have many cycles of your signal so you see the correct peaks, etc.""ted
Agreed..but look at your 14 khz waveform...you really have to wait around to see the sample coincide with the actual peak of the waveform. You are making the connection in your thinking that when the two coincide, that is the actual wave amplitude..
Reconstruction of that signal by a DAC...For the dac to really output the correct amplitude of that signal, it has to look over many samples to get the right amplitude..Hence, my point..
Now, if you were to "connect the dots", so to speak, with some filtering, you should see some envelope modulation..what is interesting is that the top of that envelope is not symmetric with the bottom one, there will be a frequency component there. And, nyquist math does not produce that artifact, unless you include the FIR response of real filters, representing the very few samples that are actually available to the filter. Also, don't forget, Nyquist math requires sample lookahead in order to work..
Thanks Ted
John
HowdyHave you read all of my responses on this thread?
You don't have to wait for the peak. Look at the waveform that Cool Edit Pro displayed. The program had no idea what I gave it. Here's what I gave it:
#include#define _USE_MATH_DEFINES
#includeint main () {
const double sr = 44100;
const double sp = 1/sr;
FILE * h = fopen("out.pcm", "w");
for (double t = 0; t < 1; t += sp) {
double a = sin(t * (M_PI * 2) * (sr / (44000.0l/14000)));
short s = int(a * 32767);
fwrite(&s, 2, 1, h); }
fclose(h); }
Cool Edit Pro (and your DAC) have no idea what waveform I gave, but the peak is reconstructed accurately from the samples present.
Anyway go listen to your 14kHz sampled and reconstructed at 32k, 44.1k, 48k, 96k, etc. They all sound the same to my ears and have the same amplitude. It also agrees with theory. Why would I believe yours eyes instead of mine and my ears and the theory?
HowdyShould anyone want to play with this stuff to recreate my examples you might want this slightly corrected code. If you don't open the file in binary you'll get weird extra bytes now and then :)
#include#define _USE_MATH_DEFINES
#includeint main () {
const double sr = 44100;
const double sp = 1/sr;
FILE * h = fopen("out.pcm", "w+b");
for (double t = 0; t < 20; t += sp) {
double a = sin((2 * M_PI) * (t * 154350.0l/11));
short s = int(a * 32767);
fwrite(&s, 2, 1, h); }
fclose(h); }
""Cool Edit Pro (and your DAC) have no idea what waveform I gave, but the peak is reconstructed accurately from the samples present.""TEDTed...try presenting it the samples from .19625 to .19655 only.
Bet it doesn't give you the correct peak..
Looked at the notation you provided..fraid I'm clueless as to what it says..my fault, not yours..
What is the math cool edit pro uses to reconstruct the underlying waveform? is it the same math that is applied to the output of a CD??
At first, I had thought the oversampling techniques did that, but apparently not.
""Anyway go listen to your 14kHz sampled and reconstructed at 32k, 44.1k, 48k, 96k, etc. They all sound the same to my ears and have the same amplitude.""ted
The only thing I have to play it back on here is cd type stuff..so I can't yet do that..My newer 24/192k card may support that, but it's still in the box..I think I'll just build a new computer around it instead of the infernal problem of "new hardware found".
""It also agrees with theory.""ted
In theory, yes..but the application is not up to the theory. My DSP prof's never used truncated signals to support nyquist. They did, however, show how truncated signals cannot provide optimal reconstruction. Some kind of convolution between the sampling window and the signal of interest, from what I recall..definitely fuzzy on that, though.
""Why would I believe your eyes instead of mine and my ears and the theory? :)""ted
Ummmm because I'm such a nice guy???. :-)
A really cool test of what we speak? Take the pure file, .wav it, play it into a typical CD player, and scope it..Then use a parametric set high Q, look for the artifacts I see with my eyes..by scanning the parametric across the 500 hz to 5 k range.
You're correct..It's my eyes here, not my ears..And I also think I wouldn't hear a diff over the rates..
I love this crap....
Thanks Ted,
John
BTW, does 25 dollars get me the ability to put pics on AA? Cause I really like AR for that capability.
HowdyIf you give a DAC or the program too few samples you are convolving a rectangular window which by definition has infinite bandwidth.
The code I gave is C++ and it generated the .wav file I used as input to Cool Edit Pro and that I played out my DACs.
Cool Edit Pro is simulating a DAC by applying the correct brick wall filter and then resampling at the rate dictated by the number of pixels on the screen (or thereabouts) to draw the waveform.
Sorry I don't have to do your parametric filter test, I've been there, done that, etc. If I had my Digital Audio Workstation alive I would do the experiment just to humor you, but then you'd need to understand it's algo's to believe that it's doing the experiment you want. On the other hand I don't happen to have this kind of analog equipment laying around at my house to do the experiment in the analog domain. But like I said I used to do this stuff for a living and remember people arguing about this till the cows came home. I also have bad memories of people not getting it in school when they were only doing the math and clearing things up for them in another lab where I had the equipment to demo things for people. In a previous life I've written similar display code to that of Cool Edit Pro, just so customers didn't get confused.
Just because I thought you might ask, tho, I did play this file thru three of my DACs and got the same answer, no 1k envelope modulations (boy I'm glad my daughter wasn't here when I played that, she'd be complaining that I'm deaf at that freq.)
Yep, make a donation to the Asylum and get hosting for anywhere. Rod doesn't limit the pictures to just be displayed at this site.
Did you try the limited sample size on the program? When you do, please post the pic..I remain unconvinced...But I'm really enjoying the conversation..thanks Ted..
When I get the chance, I'll put together the analog stuff to prove it either right or wrong..but I fear my time budget makes for a large queue.
I don't know if it's 1k envelope mods, or some weird thing. But I'll certainly think about all you've said..
Donation? Cool, I'd love to post some pics..got my 100 foot linecord/mike/snake that doesn't hum..my 18 pole resistive high bandwidth coaxial load..and soon enough, my IA setup..along with the pc test setup.
HowdyHere's a selection:
Here's the display after pasting that selection into a new waveform:
You can see the window effects caused by assuming that the other samples are zero.
I know..that's what I've been talking about..The DAC does not have the information from the future, nor the past..The output filter will only have the past..
And note..how would a filter output a signal that is higher in amplitude than the sample? points 4.5 and 9 come to mind.
Ted...thanks for this cool discussion..going offline now, be back monday..gotta take the kidlets to see medallion..
HowdyOf course a reconstruction filter produce outputs higher than the input, otherwise how could they reproduce the original waveform without waiting for a peak :) A reconstruction filter isn't just a smoothing filter. Anyway ever hear of filters ringing? If you hit a reconstruction filter with a single non-zero sample, you'll not only get an output of some amplitude at that point but also non-zero outputs at other points, when there are more than one sample those other "spurious" outputs can overlap constructively or destructively and cause the output at any given point to be higher or lower than you might otherwise expect.
The reconstruction filter is a part of the DAC.
To do a proper brickwall filter it must look into the future a little, (by delaying the output a little) but that has it's own problems...
There is no such thing as an ideal implementation of a reconstruction filter, but in any case the better the filter, the better it's time resolution... which is what brought the whole thing up in the first place.
is the idea that you can completely create a sine wave at or near the Nyquist freq with only a couple of points.I think the key concept is that the data points allow only one waveform to be reconstructed that does not have components above the Nyquist freq. In other words, in order to create any sharper curvature in the waveform, you would need higher freq components that cannot exist.
This also means, of course, that you don't need to have the peaks, or any other particular part of the waveform, sampled in order to recreate the band-limted wave (as you said before).
Boy, this is easier to understand than it is to explain.....
Howdy"Boy, this is easier to understand than it is to explain....."
You said a mouth full there. There is a reason some (well motivated) people drop out of signal processing theory classes :) And here on the internet you don't even have the advantage of knowing the audience and the audience having the requisite background.
Agree on mouthful and audience.To recover the peak signal, the reconstruction math has to work quite hard, and requires samples around the peak of interest.
There will be a tradeoff between the window size and the ability to reconstruct the waveform beyond the simple DAC hold between samples.
I make the assumption that most CD outs are simple filtering of the staircase DAC output signal after the hold circuit.
I do like the thought of a digital brickwall filter, as that could easily include a large sample delay for better implimentation and reconstruction. My thinking has been only on analog filtering.
I don't know what is right, because I don't do digital,but thanks for the info. Ted. I can learn something from this exchange.
This post is made possible by the generous support of people like you and our sponsors: