Using Centripetal Catmull–Rom spline in place of oversampling - diyAudio
Go Back   Home > Forums > Source & Line > Digital Source

Digital Source Digital Players and Recorders: CD , SACD , Tape, Memory Card, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 9th April 2015, 09:45 PM   #1
dundy is offline dundy  Australia
diyAudio Member
 
Join Date: Apr 2015
Default Using Centripetal Catmull–Rom spline in place of oversampling

This discussion is aimed more at people with electronic knowledge and contains such terminology.

I was reading up about DAC methodologies like R-2R with some enthusiasts saying how much better it is than Delta-Sigma etc. I understand that Delta-Sigma is chosen for cost reasons. It is expensive to manufacture a laser trimmed R-2R ladder IC which is why manufacturers look at other alternatives.

It occurred to me that a VERY smooth output could be achieved by using a Centripetal Catmull–Rom spline to calculate a smooth interpolation between steps at any reasonable desired sampling rate. Instead of oversampling by 256, use the above spline formula to calculate 256 new points along a smooth curve between the known samples.

It is 2015 and there are plenty of powerful low cost microcontrolers that can do the job.


My idea for making a better affordable DAC is to use a PWM constant current to charge and discharge a capacitor, similar to how class D amplification works, but using a microcontroler and spline calculations to construct the PWM signal.

My reason for choosing a constant current over the usual LC circuit is that it is far easier to calculate perfect PWM timings when using a constant current. LC circuits are curved and good luck trying to figure out where your pulse fits onto that curve.

Any thoughts from the experts?
  Reply With Quote
Old 10th April 2015, 10:27 AM   #2
HpW is offline HpW  Switzerland
diyAudio Member
 
Join Date: Mar 2002
Location: Switzerland (Bern)
Quote:
Originally Posted by dundy View Post
This discussion is aimed more at people with electronic knowledge and contains such terminology.

I was reading up about DAC methodologies like R-2R with some enthusiasts saying how much better it is than Delta-Sigma etc. I understand that Delta-Sigma is chosen for cost reasons. It is expensive to manufacture a laser trimmed R-2R ladder IC which is why manufacturers look at other alternatives.
Wadia is may the only one who started/introduced spline oversampling some decade ago using the PCM1704 DAC.

I own a 27 WADIA and can tell you about the pleased hearing experiences... but requires high resolution speakers (Magnepan), tube gear and not boom boom music at all

The benefit against traditional FIR oversampling is the smaller overshoot, no much cap's in the signal path and use of low plastic for the connection wires ...

I had once a paper claiming a overshot (post & pre echo) below 1/100 of the main peak will not be hear able...

just my 2 cents

Hp
__________________
Author of PC based FFT Spectrum Analyzer since 1995
www.hpw-works.com
  Reply With Quote
Old 10th April 2015, 10:32 PM   #3
dundy is offline dundy  Australia
diyAudio Member
 
Join Date: Apr 2015
Hi HP

I just looked at the specifications of the PCM1704 DAC and it makes no mention of spline usage. Perhaps you are referring to another DAC?
  Reply With Quote
Old 11th April 2015, 09:40 AM   #4
DF96 is offline DF96  England
diyAudio Member
 
Join Date: May 2007
Quote:
Originally Posted by dundy
It occurred to me that a VERY smooth output could be achieved by using a Centripetal Catmull–Rom spline to calculate a smooth interpolation between steps at any reasonable desired sampling rate. Instead of oversampling by 256, use the above spline formula to calculate 256 new points along a smooth curve between the known samples.
Why do you want a "very smooth" output? The main aim of splines is to provide a curve which looks nice to the eye, not one which correctly replicates the input to a sampling process.

As a little exercise for yourself, use a spreadsheet (or Matlab etc.) to sample a 22kHz sine wave at 48kHz (or 20kHz at 44.1kHz). What sort of spline will enable you to recover the sine wave, and reject the image at a slightly higher frequency and slightly lower amplitude?
  Reply With Quote
Old 11th April 2015, 10:13 AM   #5
dundy is offline dundy  Australia
diyAudio Member
 
Join Date: Apr 2015
I don't think that any existing technology will accurately recover a 22kHz sine wave sampled at 40 something kHz. My point was that Delta-Sigma was implemented as a cheap alternative to costly laser trimming of R-2R ladders.

A microcontroler decoding SPDIF into analogue using my proposed method surely has to be better than Delta-Sigma, yet just as cost effective.

As for wanting smooth output, I was referring to the step staircase effect that even R-2R can't avoid. Spline solves that. ( but not at 22kHz obviously)
  Reply With Quote
Old 11th April 2015, 04:04 PM   #6
benb is offline benb  United States
diyAudio Member
 
Join Date: Apr 2010
Have you read this book? It's free online, and highly recommended:
The Scientist and Engineer's Guide to Digital Signal Processing
  Reply With Quote
Old 11th April 2015, 06:27 PM   #7
DF96 is offline DF96  England
diyAudio Member
 
Join Date: May 2007
Quote:
Originally Posted by dundy
I don't think that any existing technology will accurately recover a 22kHz sine wave sampled at 40 something kHz.
A 22kHz sine wave can be recovered from a 48kHz sampling stream. 20kHz sine waves are routinely recovered from 44.1kHz sampling in every CD player on the planet.

If you want to suggest new methods for DAC it might help if you start by learning about how the current technology works. Not just the DAC itself, but also the reconstruction filter. If you draw "smooth" curves through samples where the sampling frequency is very high compared with the signal frequency you can easily fool yourself - newbies do it on here all the time. Move up nearer the Nyquist limit as I suggested and you should start to see how digital audio really works. "Smooth" curves may play a limited role, but the real issue is good filters.
  Reply With Quote
Old 12th April 2015, 08:52 AM   #8
HpW is offline HpW  Switzerland
diyAudio Member
 
Join Date: Mar 2002
Location: Switzerland (Bern)
Quote:
Originally Posted by dundy View Post
Hi HP

I just looked at the specifications of the PCM1704 DAC and it makes no mention of spline usage. Perhaps you are referring to another DAC?
I STATED that WADIA 27 (using PCM1704 Dac's) uses a spline!

Really 8 times linear oversampling and then a spline... Search on wadia.com or google wadia 27

Hp
__________________
Author of PC based FFT Spectrum Analyzer since 1995
www.hpw-works.com
  Reply With Quote
Old 12th April 2015, 09:41 PM   #9
dundy is offline dundy  Australia
diyAudio Member
 
Join Date: Apr 2015
Thank you HP. I just looked it up and saw that WADIA 27 did use a spline for the exact reasons I want to use it for.

A quote from another discussion...

Quote:
with Wadia's algorithms you are effectively listening to CD at SACD/DVD-A resolutions. Their spline fit algorithm fills in the interpolation of the upsample without just leaving blanks, or simple connect the dot functions used in many other systems as filler. What their algorithm can't do is reproduce the EXACT original analog signal. What it can do is approximate it to such an extent that its sound is SACD/DVD-A resolution (truly). The only real argument to be had is, "well, it still is approximated analog, not the true recording".
And to DF96, I'm hardly a newby. I have been an engineer in the electronics and software fields since 1980 and am quite familiar with "how the current technology works. "
There is still no way you can accurately recover the original signal (20kHz sampled at 44.1kHz) because that equates to just two samples per cycle. Those two samples do not contain sufficient information to tell you if it was a sine wave, triangular, square or some combination of those.

Reconstruction filters are therefore a compromise or an interpolation of the original signal. They assume a smooth transition from one sample to the next, and in "every CD player on the planet" the reconstruction filter boils down to a low pass filter of some sort.

See the wikipedia page for The Whittaker–Shannon interpolation formula or sinc interpolation is a method to construct a continuous-time bandlimited function from a sequence of real numbers.

On that page it states "This is equivalent to filtering the impulse train with an ideal (brick-wall) low-pass filter."

It's not that smoothing "may play a limited role", it's a case of smoothing being the entire point of the reconstruction filter.

The spline formula, in my opinion (and Wadia's) should do a better job of it than "current main stream technologies".

I started this thread because I was thinking about using a single microcontroler to stereo decode SPDIF, create a PWM signal and smooth it with a spline. I had googled DAC and spline and came up empty so asked on this forum expecting that someone might know something about using splines with audio.
  Reply With Quote
Old 12th April 2015, 10:27 PM   #10
SY is offline SY  United States
diyAudio Moderator
 
SY's Avatar
 
Join Date: Oct 2002
Location: Chicagoland
Blog Entries: 1
Quote:
Originally Posted by dundy View Post
There is still no way you can accurately recover the original signal (20kHz sampled at 44.1kHz) because that equates to just two samples per cycle. Those two samples do not contain sufficient information to tell you if it was a sine wave, triangular, square or some combination of those.
Perhaps it's time for you to review Shannon-Nyquist? You might also want to think about what the Fourier expansions of 20kHz square waves and triangle waves comprise.
__________________
“The short explanation is always dull. It generally includes the word ‘just.’ The explanation only becomes beautiful when you immerse yourself in every nuance.”
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MP3 PLAYER from PC CD-ROM or DVD-ROM Radu1984 PC Based 1 25th September 2011 05:56 PM
Oversampling - where does it take place? audio_tony Digital Line Level 3 20th December 2008 08:48 AM
CD-Rom controller including Remote Control and CD-Rom power supply BCP99 Swap Meet 2 22nd April 2007 02:03 AM


New To Site? Need Help?

All times are GMT. The time now is 02:30 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2015 DragonByte Technologies Ltd.
Copyright ©1999-2015 diyAudio

Content Relevant URLs by vBSEO 3.3.2