Sample Rate Conversion

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Thanks. Bits of my degree are starting to come back now plus, in later life, we used deliberate under-sampling as a way to down-convert IF to baseband in WiFi and 4G systems. Basically grabbing one of the image repetitions.

So, the answer to how you get stair-steps back to audio without a filter is with a filter (somewhere). I thought as much.
I have tolerated under sampling in microprocessor based LED meter front ends because aliasing did not appear to damage peak and/or average amplitude meter displays.

JR
 
It might be worth noting one difference in theory vs practice. In theory the reconstruction filter is what converts discrete time to continuous time, this is often represented as a convolution of the samples with a sinc function. In practice the conversion from discrete to continuous can happen before the filter. The filter is more about performance and can therefore sometimes be omitted altogether, it is not actually required for reconstruction as it is in the theory. Imo image rejection or anti-imaging filter is more appropriate when describing real world systems of this type.
 
That sounds more confusing than it needs to be. I learned back in the 70s that anti-alias filters were applied to inputs before time sampling (to prevent birdies), and anti-imaging filters to outputs to scrape off sampling clock frequency step energy between samples.

JR
 
tbh it seems we are all basically saying the same thing but articulating it in different ways.
The way I look at it is that essentially the "staircase steps" do exist either in numerical and/or physical (voltage) terms and requires a "reconstruction filter" to errr...reconstruct the original analogue waveform (subject obvs to imperfections). How that filter is implemented is a different issue but there is a filter even if it is not described as such eg a transformer. Such approaches have some following in the esoteric end of the 'Hi Fi' spectrum based on audible results rather than the standard metrics of THD / IMD etc.
What seems a mystery to some audio, but not technical, people is the idea that you can't simply join the sample values with "straight lines". Rather, there is a maxim rate of change due to the filter. And this can result in intersample peaks greater than the value of any sample. If you can convey the idea of how, say, a square wave is constructed by summing a series of increasingly higher frequency harmonics then that is going the right way.
Not sure if this helps...But I know what I mean -)

And not related to this thread - but I'd just like to wish peace and safety to anyone reading this in these uncertain times.

Keep Safe.
 
Thanks for the replies...I sometimes am amazed at the wealth of real life knowledge available for free on this forum...

We may not ALL be rocket scientist but at least we can drink like them!
 
Seems to me that this thread is rather oversimplifying things as they exist in the real world. Two things come to mind. First is the effect of jitter in the clocks of the converters - since the signal is moving, time errors (jitter) translate directly to amplitude errors. Clocks are most often derived from crystal oscillators that, by their nature, are microphonic. Jitter in a DAC can be created by having the clock oscillator exposed to sound from the playback loudspeaker. I've always thought there should be an enclosure of some sort to isolate the crystal from sound. Second is the effect of an inadequate passive reconstruction filter at DAC outputs. The residual sample-rate signal is at a frequency where any downstream active circuitry (especially op-amps) is running out of gain-bandwidth - opening the door to cross-modulation with harmonics of the signal itself. The complex cross-modulation creates new frequencies that can fall in the audible ranges ... a kind of non-harmonically-related "regurgitation" distortion that the late Deane Jensen referred to as "spectral contamination". I think both of these issues are under-appreciated ... and may explain why some "golden-eared crazies" may hear these artifacts.
 
Seems to me that this thread is rather oversimplifying things as they exist in the real world. Two things come to mind. First is the effect of jitter in the clocks of the converters - since the signal is moving, time errors (jitter) translate directly to amplitude errors. Clocks are most often derived from crystal oscillators that, by their nature, are microphonic. Jitter in a DAC can be created by having the clock oscillator exposed to sound from the playback loudspeaker. I've always thought there should be an enclosure of some sort to isolate the crystal from sound. Second is the effect of an inadequate passive reconstruction filter at DAC outputs. The residual sample-rate signal is at a frequency where any downstream active circuitry (especially op-amps) is running out of gain-bandwidth - opening the door to cross-modulation with harmonics of the signal itself. The complex cross-modulation creates new frequencies that can fall in the audible ranges ... a kind of non-harmonically-related "regurgitation" distortion that the late Deane Jensen referred to as "spectral contamination". I think both of these issues are under-appreciated ... and may explain why some "golden-eared crazies" may hear these artifacts.
I would expect better designs to run narrow bandwidth PLLs off the crystals, which would greatly reduce the microphonic effects. Perhaps john12ax7 might have some info from real world designs?

With higher sampling rates and / or deliberate oversampling in the DACs, you can push those image spectra much further away than what you would expect with a simple Nyquist criterion design.

Sure, nothing is perfect, but there are ways to really minimise these artefacts if you want to spend the money.

I seem to recall there is a website somewhere that has artificially massively exaggerated jitter on recordings for you to do listening tests. Worth looking up.
 
This is perhaps TMI but I got pretty involved in anti-alias and anti-image filters for BBD delay line designs back in the 70s. "Image" in anti-image is code speak for the transient steps between samples. Rate of change wrt filter topology is a whole chapter for that book (nobody wrote).

The input anti-alias filters were pretty straightforward. Just reduce signal energy for input audio that could beat or create aliases with sampling frequencies. Anti-image filters are not a strict mathematical relationship but more about preventing clock/sample frequency content from causing noise/interference elsewhere. I learned the hard (only) way that the limited gain bandwidth of 70s era op amps could have trouble cleanly filtering out transient steps in sampled output signals. By trial and error (heavy on error) I discovered that some op amp filter topologies were less suited to filtering out sharp transient edges. In my experience active multi-pole filters that included a real pole as one of the stages were most stable for scrubbing out high edge rates if you put the real pole first.

If that wasn't already TMI, for severe multipole filters location or parsing of under-damped (filter stages that rise before falling) with over damped stages. The hairiest delay line filter I every designed combined a multiple pole chebyschev alignment with a HF pre/de-emphasis circuit to manage HF noise. I combined the de-emphasis pole with the over-damped real pole in the chebyschev alignment.

Circa 70s op amps could not handle clock frequency transients in several filter topologies, The one that used a grounded C in the input proved more stable with clock edges.

JR
 
I suggest all of you might find it interesting to read the data sheet of the CS8421 from Cirrus Logic. I was the applications engineer who supported the introduction of their first SRC the CS8420.
 
I saw that video (and the tonewood, or lack thereof, one) the other week - great work there, which only went on to reinforce, well, y'know... LOGIC 😁


I watched that video on my iPhone. I heard clear and what I would consider significant tonal differences in his examples. I came to the opposite conclusion. I have no dog in the race. I don't play guitar or work on them. Don't even record them.
 
...
Circa 70s op amps could not handle clock frequency transients in several filter topologies, The one that used a grounded C in the input proved more stable with clock edges.

JR
Perhaps I should have said "Second is the effect of an inadequate passive reconstruction filter at DAC outputs" in my post. Active filters are notoriously bad at dealing with nanosecond rise-time transients (creating cross-mod distortions). This fast stuff needs a passive filter, such as a 2-pole LC at the DAC output pin before passing on to an active filter. The fact that a simple RC low-pass is enough for a seriously oversampled DAC is probably why the oversampled parts sound cleaner than the 44.1/48 kHz baseband stuff ever did. Of course, there were the old "brick wall" anti-alias filters, that destroyed high-frequency time-domain response (making cymbals sound like they're made of lead) that did far more damage to the sound.

In 1974, I prototyped a 4-channel digital audio recorder using a VHS video transport and "state of the art" 12-bit converters and a brick-wall filter. I put in some phase-correction filtering in front of it but it was only possible to flatten the time-domain response out to about 10 kHz - but it sounded better with the correction than without. I got a patent on the recording scheme but it lacked one key element - the same technique that makes the audio CD so robust against drop-outs (dust and scratches) - interleaving and time-scattering of the data stream. So I was close, but no cigar!
 
Wouldn't that be at the detriment of jitter?

The quandary with a PLL for digital audio clocking is that the loop bandwidth must be relatively high for the loop to "acquire and lock" to a newly presented input. But, once locked, it needs to have a very low (under aa few Hz) to effectively "track" and remove jitter that's audible. I've advanced this idea for decades, but AFAIK, no one is using the technique, which incidentally is very common in other data-acquisition systems like navigation satellites where the doppler shift of the transmitted carrier signal is measured using the de-jittered loop output.
 
I've advanced this idea for decades

It has been used previously, and the components used in some of the networked audio devices lead me to believe that it is probably being used in current Ethernet audio devices as well. The Silicon Labs (err...SkyWorks now I think) type devices use digital filters for the loop filtering, which makes it a little bit easier to gracefully reduce the loop bandwidth. A friend who designed telco PLL's mentioned once that it was sometimes difficult to change the loop bandwidth on an analog PLL without disrupting the lock that had just been achieved.
 
Much easier done in analog loops with standard "soft-switching" techniques. The code-writer for doing the filter in digital would need to know more than filter theory to do a good job!
 
My comment was that AFAIK, better results are achieved without a PLL, when feasible. Adding a PLL to a crystal in order to achieve immunity to possible crystal microphonics seems to me like curing an occasional problem by introducing a permanent one.
 
I missed most of this conversation but it seems very long so maybe another viewpoint is useful. The reconstruction filter at the output of a DtoA effectively construct a segment of a 22.05KHz sine wave between every pair of samples it is sent. If you are down sampling from a higher frequency you need to exactly the same in the digital domain.

Cheers

Ian
 
The quandary with a PLL for digital audio clocking is that the loop bandwidth must be relatively high for the loop to "acquire and lock" to a newly presented input. But, once locked, it needs to have a very low (under aa few Hz) to effectively "track" and remove jitter that's audible. I've advanced this idea for decades, but AFAIK, no one is using the technique, which incidentally is very common in other data-acquisition systems like navigation satellites where the doppler shift of the transmitted carrier signal is measured using the de-jittered loop output.

I thought that was the basic approach of several audio converter designs. I'm thinking particularly of Benchmark and Prism Audio kit. An initial "PLL lock" then a narrowing of PLL bandwidth. But going back 20+ years when I had a professional involvement in this field. So I might be wrong 🙄
 
The reconstruction filter at the output of a DtoA effectively construct a segment of a 22.05KHz sine wave between every pair of samples it is sent. I
Why is it necessary, when the rest of the chain, from the D/A output to the brain, is low-passed?
I suggest two reasons:
One is to present a clean signal to a measurement system which bandwidth largely exceeds the audible range.
Another is to prevent distortion due to slew-limiting.
I surmise if we presented the raw output from the D/A - which is actually the dreaded "stairstep" signal - to a measurement set-up with a circuitry that has enough BW, followed by a brickwall filter, there would be no need for any other reconstruction filter.

The reconstruction filter is needed because of the need for neat measurements, and because amps do not behave well in the presence of glitches and tweeters do not like receiving ultrasonics.
As for the audition, I don't know how it reacts to a dose of ultrasonics. I know it has no effect when produced by an ultrasonic whistle (used for dog training), but there may be effects with prolonged exposure.

Indeed, having a well-defined recon filter is a better solution than relying on the various uncontrolled parameters of the listening chain.
A number of commercial D/A's offer a choice of responses of the recon filter. Some claim hearing distinct differences between modes. They do measure different.
 
Last edited:

Latest posts

Back
Top