Sampo Syreeni wrote:
For the longest time I took out a compiler and started cranking out an
old idea...


 In that vein, I'm using libsndfile and its (highly reasonable)
processing model: you just keep everything to zero padded ints
(preferably signed) and go from there.

The trouble is that my code is of the kind that also requires lots of
bit twiddling. My current problem comes from trying to make the code
more or les
s adaptive to any bit width, while I also have to do stuff
like computed shifts.

So, how do you go about systematically and portably implementing what
you would expect from your logical operations, using standard C
operations, without knowing the basic width of your types? (Logical, not
arithmetic) right shifts of signed quantities, efficient parity, and
computed shifts with negative offsets are proving particularly nasty at
the moment. (It has to do with dithering at arbitrary word length which
also has to be reasonably efficient if any set in silicon.)

Isn't libsndfile strickly for PCm type of signals, which isn't interpretable as thesingle bit streams like in SACD ? I mean the paradigms of the two formats differ essentially in that a PCm signal is supposed to be sampled in a frequency limited, equi-distant, and impulse sample way, whereas the SA-CD bitstreams are of course a DSD stream with "higher-lower-only" sampling with no guarantee the higher frequencies (fast changes) are sampled completely correctly at full amplitude, and a strict 3-fold high frequency loop filter set to make sure the audio coming from the DA converter is somewhat the same as during sampling.

I mean just like sample operations outside of well known IIR and some FIR filters aren't in line with perfect reconstruction in PCM sampling, theoretical Lipwitch continuity isn't how the actual AD conversion creates the DSD bits, and vanderkooy simply states the dual problem of the "delta-encoded AD conversion" wrt the sampling theorem, where aliasing is unpreventable in the higher frequencies, meaning in the case of DSD there's no way to know the exact input signal from the samples, instead of the perfect reconstruction possibility for the well executed PCm AD conversion (Which is nearly impossible for CD rates because of requiring theoretically non-realizable phase correct filters). Working on the DSD stream is somewhat easier than making filters which have perfect reconstructable effects within certain parameters, but should include the 3 analog filter poles in their interpretation to be comparable with lets say playing the DSD over the DA converter, doing some sort of processing, and converting back to a corect DSD stream. Of coruse it's fun to play with the bits, but it requires keeping track of the state and the effect of the analog poles (or some equivalent you make in sw) to do correct filtering, and edits which don't molest the natural transients!

I recently heard a Pyramid DSD system play back an old Reel to Reel master tape (from a Studer) which sounded pretty good, especially in that the DA converter mid range sampling errors which so dominate the PCm world were largely absent. It's an expensive system still, and i'd imagine the software to *correctly* process (instead of mix or transfer) a DSD bitstream isn't easy.

Unix has bit operations already since pretty early on (the 70s) like for file descriptor state bitsm I'm sure you are aware of the hardware (processor) issues with this, and that most processors have hardware ops for shifting, anding, and repeated memory operations, but hey, thats pro programming, of course. I'd have to look up what C99 exactly does more than some styles and a few extension, but I'm a great proponent of bringing progamming problems back the essence instead of wasting Gigaherzes and Gigabytes on enormous overhead for processing bits ;) (FPGA's like in the upcoming Parallella boards should be able to do very efficient and big mounts of bit twidling)

T.V.
--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp

Reply via email to