'Chibi' phase inverting mod.

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Re: IT IS NOT £$&%&^G DC

rfbrw said:
Oh and one more thing. IT IS NOT DC. The data being inverted is dynamically varying. It is audio data.

Now I see your Problem ... (I hope)

input data:
+9 +8 +7 +6 +5 +4 +3 +2 +1 0 -1 -2 -3 -4 -5 -6 -7 -8 -9

"correct" inverted data:
-9 -8 -7 -6 -5 -4 -3 -2 -1 0 +1 +2 +3 +4 +5 +6 +7 +8 +9

inverted data with e.g. a 7404:
-A -9 -8 -7 -6 -5 -4 -3 -2 -1 0 +1 +2 +3 +4 +5 +6 +7 +8

difference between both inverted data:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

=> The Error is only DC !

You always have 1LSB less current/voltage at the output as it should be. If you need, you could add it there, but it is DC you need to add ...


Regards

Jobstens
 
Lets try again. Maybe I can teach an old dog new tricks.
The following sequence represents the LSB's of a series of audio samples

0,1,0,1,0,0,0,1,1,0,0

inverting and NOT adding the one yields

1,0,1,0,1,1,1,0,0,1,1

Now unless you can guarantee the LSB of every sample in the source data is a zero, I do not see how the error due to not adding 1 can be classified as DC.
 
I'm not that old :D And i the DSP thingie was a joke.

Anyway, i never said the LSB sticks to 1!

In the example of the crystal datasheet it does, but that is because it sticks to zero in the non inverted case (the example is 24 bit i2s with 16 bit used, last 8 bits are static value).
Lets forget about it for a moment.

Now back once more to the bits and pieces ;)

Say incoming is 4 bit data:

0 1 2
0000 0001 0010

Inverted
1111 1110 1101

Values inverted:
-1 -2 -3

Perform +1 calculation to do it 'correctly'
0000 1111 1110

Values inverted and +1 calculation
0 -1 -2

As you can see the difference between 'values inverted' and 'values inverted and +1 calculation' is 1. And it is always 1, that is what i call DC.

So i mean the numerical value NOT the bits. And a numerical value of 1 corresponds with the lsb, hence the term 'one lsb off'.

And yes, the lsb varies with music (i'm not that stupid). It does in the source, it does in values inverted and it does in the case of values inverted and +1 calculation.

Sorry, but i cannot make it any clearer.
 
guido said:

In the example of the crystal datasheet it does, but that is because it sticks to zero in the non inverted case (the example is 24 bit i2s with 16 bit used, last 8 bits are static value).
Lets forget about it for a moment.

Eh, badly put into words. The crystal example gives an example where the lsb is NOT part of the music. It is part of a filler of 8 bits.
If filler = 00000000, it is a dac with 16 bit resolution.
If it is static non zero it is a dac with offset on the output. 00000001 is static non zero. And numerical adding the value 1 to 24 bit data with last 8 bits set to 00000000 gives the value 00000001 for those last 8 bits.

I was trying to say that adding a constant value to all of the samples results in DC (crystal example), likewise as it is not to do that (+1) when inverting i2s.

It's getting late...
 
Other (really, really, really last ) try.

If you constantly feed your DAC with the same digital value, you have DC at output - right ?

If you are adding a constant to your audio-data, you have added DC to your audio-signal - right ?

You want to add 1 (DC!) to the audio-data because they are shifted down by 1 (DC too!).


and: don't look only on the LSB.


Regards

Jobstens
 
THERE IS NO £$%^&*G DC. END OF STORY.

You are wriggling like a fish on a hook. Who gives a gnats gonads about some abstract musings on numerical formats. To get DC out of a dac you need a continuous series of the same sample and you haven't got that in audio.
Guido, when you find yourself in a hole it's best to stop digging.
 
Re: THERE IS NO £$%^&*G DC. END OF STORY.

rfbrw said:
You are wriggling like a fish on a hook. Who gives a gnats gonads about some abstract musings on numerical formats. To get DC out of a dac you need a continuous series of the same sample and you haven't got that in audio.
Guido, when you find yourself in a hole it's best to stop digging.

You are right lets leave it. You dont see it the way i do and the other way around. You think i'm in a hole, i think i'm not.

Two last remarks from my side:
To get audio out of a dac, you feed it with audio samples.
To get DC out of a dac, you feed it with continues series of the same sample.

To get audio+DC out of a dac, you feed it with the sum of audio samples and a continues series of the same sample.
Say the value of that continues sample is -1.
audio+dc = audio+offset.

Remark two: i do give a gnats gonads (whatever that is) if i don't have to solve a problem that does not exist. So instead of mucho logic or cpld stuff i can use an inverter.

You may now have the last word, unless i find a link to a doc explaining it all (i searched a bit, no luck). I'm back to my :Popworm:
 
For your Ears ...


sin441Hz.wav
- 2 seconds sinus 441Hz @ 44100, mono, 3 Bit (!)

sin441Hz_inv.wav
- the same, just inverted

sin441Hz_inv_-1lsb.wav
- same as the inverted, but every value decremented by one

sin441Hz_inv_+lsberr.wav
- same as the inverted, but LSB randomly


=> you hear no difference between the first 3 files.
=> you hear if the LSB is wrong (last file).



Regards

Jobstens
 

Attachments

  • sin441.zip
    3.7 KB · Views: 62
jobstens said:
Other (really, really, really last ) try.

If you constantly feed your DAC with the same digital value, you have DC at output - right ?

If you are adding a constant to your audio-data, you have added DC to your audio-signal - right ?

You want to add 1 (DC!) to the audio-data because they are shifted down by 1 (DC too!).


and: don't look only on the LSB.


Regards

Jobstens


Herr Doktor Ing. Jobstens, enough with the abstractions. The 1 does not exist in isolation. In some cases the impact of the 1 will be to make the LSB a 0, in others a 1. It does not matter how you spin it, the LSB is varying. If you add a constant to a variable, in this context, you still have a variable. It does not matter what the rest of the word is doing, if the LSB is varying then the whole word is varying even if it is only by a small amount. And that is all that matters as the dac deals with the whole word.
rfbrw, out.
 
rfbrw said:



Herr Doktor Ing. Jobstens, enough with the abstractions. The 1 does not exist in isolation. In some cases the impact of the 1 will be to make the LSB a 0, in others a 1. It does not matter how you spin it, the LSB is varying. If you add a constant to a variable, in this context, you still have a variable. It does not matter what the rest of the word is doing, if the LSB is varying then the whole word is varying even if it is only by a small amount. And that is all that matters as the dac deals with the whole word.
rfbrw, out.

Errr,

Was not going to react anymore, but i feel i have to:
I agree to most (or all?) of the above (except maybe the Herr Doktor Ing) thingie !! :att'n: Yes, the one does not exist in isolation, yes the impact of the one will make the lsb a 0 or a 1, yes, the lsb is varying, yes var1+const=var2 (i assigned some numbers). But how is then the word varying?

The statement is that var2 is varying like var1, the differenence is a fixed constant being '-1' (looking at the values of the whole word, comparing var1 and 2 for sample1, sample2, sample3...).

The question is then is how the dac reacts to a feed with var2.
 
The word varies in that it changes from sample to sample. Unless you listen to Glass or Stockhausen.
Can we now kill the utterly pointless continuation of this thread? You are going do thing your way, Jobstens is going to things his way and I'm going to do things the right way, so nothing is going to change. Now, I shall attempt to follow my own advice.
 
rfbrw and jbokelman

Y' all have made your point to me in this thread. I just need to put a pen to paper now. I was just reading over some simular stuff on 2's comp coding in an old analog-digital coversion note book back from the 80's, so I not dismissing what you've both has stated.

My head can be fairly hard. :D
 
Wow what a hugely confusing thread! Not the subject matter, but who is saying what and why. I think it's best that I remain at least partially confused.

My thoughs on the matter of inverting digital data:

I often think of digital zero as the halfway point between the 2 middle samples - in 2's complement this is -0.5 (I think). In a properly dithered PCM signal, the DC point in 2s complement is also -0.5. In offset binary it is 32767.5 for 16 bits. (Think about a 1 bit DAC if you don't believe me.)

So inverting the bits is the correct way of inverting the signal (without introducing a DC offset). If the signal is recorded so that binary zero corresponds to voltage zero, then it has a built in +0.5 LSB offset. Inverting the data bits on it will then introduce a 1 LSB offset. Evidently some people do care.

But it can be a Bad Thing: Inverting the bits and adding 1 (subtracting? never can remember) has the nasty side effect that full scale overflows, giving nasty distortion. Many CDs are recorded with a significant amount of clipping, and in some this is maxed out + and - fullscale signals. In 2s complement, the full scale swings are unequal: -32768 to +32767.

On a slightly related subject, CD players mute at binary zero, which is a slight offset. Or maybe they compensate. DKDC.

Conclusion: Audio signals "should" be recorded and treated so that zero is halfway between 0000... and 1111.... (or 0111 and 1000 in offset binary).

There is something to be said for vinyl.

(edits: typos)
 
Though it's been said already, simply inverting the I2S data line for 16 bit I2S data will transform -32768->0->32767 to 32767->1->-32768. Inverted phase, DC offset of 1LSB.. For 24 bit DACs it's the same thing but the 1LSB error probably isn't even measurable. I wouldn't be too concerned about it.

I have no idea if the mod produces any audible effect or not, but I'd imagine it's the same as reversing the +/- on your speakers.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.